Difference between revisions of "BlackBerry : Develop Simple Apps"

From CDOT Wiki
Jump to: navigation, search
Line 3: Line 3:
 
== Read Code from the BlackBerry Samples ==
 
== Read Code from the BlackBerry Samples ==
 
[http://docs.blackberry.com/en/developers/subcategories/?userType=21&category=Sample+Applications Here are some of the most important BlackBerry Samples]
 
[http://docs.blackberry.com/en/developers/subcategories/?userType=21&category=Sample+Applications Here are some of the most important BlackBerry Samples]
 +
''The content from BlackBerry developer site has been used for these notes for which a grateful acknowledgment is made.''
  
 
---------------------------
 
---------------------------
Line 28: Line 29:
 
[http://docs.blackberry.com/en/developers/deliverables/7721/Custom_buttons_sample_app_overview_546026_11.jsp Overview]
 
[http://docs.blackberry.com/en/developers/deliverables/7721/Custom_buttons_sample_app_overview_546026_11.jsp Overview]
  
The custom buttons sample application demonstrates how to extend the Field class to create a variety of different button UI components.
+
'''The custom buttons sample application demonstrates how to extend the Field class to create a variety of different button UI components.'''
  
 
The sample application demonstrates how to create the following types of buttons:
 
The sample application demonstrates how to create the following types of buttons:
Line 41: Line 42:
  
 
In addition to creating and displaying these custom buttons, the sample application also demonstrates how to attach listeners to these custom buttons. Listeners are components that execute code when an event occurs. In the sample application, when you click one of these buttons, a dialog box appears with text specifying which of the buttons you clicked.
 
In addition to creating and displaying these custom buttons, the sample application also demonstrates how to attach listeners to these custom buttons. Listeners are components that execute code when an event occurs. In the sample application, when you click one of these buttons, a dialog box appears with text specifying which of the buttons you clicked.
 +
----------------------
 +
 +
=== Decor ===
 +
[http://docs.blackberry.com/en/developers/deliverables/9076/Decor_sample_app_overview_672047_11.jsp Overview]
 +
 +
'''The decor sample application demonstrates how to create custom fields by specifying their border, padding, color, and background attributes.'''
 +
 +
You can use the sample application to create fields that have the following attributes:
 +
 +
* solid rounded border with a solid background
 +
* dotted rounded border with a transparent background
 +
* dashed simple border with a gradient background
 +
* dotted simple border with no padding
 +
* beveled border with an image as a background

Revision as of 12:56, 24 February 2011


BlackBerry Activities



Start the lab activities in the order defined below:

Read Code from the BlackBerry Samples

Here are some of the most important BlackBerry Samples The content from BlackBerry developer site has been used for these notes for which a grateful acknowledgment is made.


Active Text Fields

Overview

The active text field sample application shows how a BlackBerry® device user can access customized items from the context menu when a pattern is recognized in an active text field. You can create active text fields by using theActiveAutoTextEditField class and ActiveRichTextField class.

When the BlackBerry device starts, the application, pattern, and associated menu items are registered with thePatternRepository. When text with the matching pattern is found in an active text field, the text is highlighted. When the user clicks highlighted text, the context menu is displayed with the menu items that are associated with the pattern.

In the sample application, when the user types a nine-digit number into an active text field, the user can click this number and a context menu with Status and Location options appears. When the user clicks one of the options, the application displays the requested information.


Bitmap Scaling

Overview

The bitmap scaling sample application demonstrates how to scale the size of a Bitmap image.

The sample application demostrates how to scale an original Bitmap image into new Bitmap objects, how to apply filters that help reduce the pixelated appearance of a scaled Bitmap image, and how to preserve the aspect ratio of the image.


Custom Buttons

Overview

The custom buttons sample application demonstrates how to extend the Field class to create a variety of different button UI components.

The sample application demonstrates how to create the following types of buttons:

  • rectangle
  • triangle
  • octagon
  • rectangle with a fixed width
  • rectangle with a fixed width and a long text label
  • rectangle with a full screen width
  • rectangle with a color background
  • rectangle with a .bmp image as the background

In addition to creating and displaying these custom buttons, the sample application also demonstrates how to attach listeners to these custom buttons. Listeners are components that execute code when an event occurs. In the sample application, when you click one of these buttons, a dialog box appears with text specifying which of the buttons you clicked.


Decor

Overview

The decor sample application demonstrates how to create custom fields by specifying their border, padding, color, and background attributes.

You can use the sample application to create fields that have the following attributes:

  • solid rounded border with a solid background
  • dotted rounded border with a transparent background
  • dashed simple border with a gradient background
  • dotted simple border with no padding
  • beveled border with an image as a background