User interface



Home screen shortcuts

You can create shortcuts and add them to the Home screen on the BlackBerry device by using the new Shortcut API that is provided in the net.rim.blackberry.api.homescreen package. When a user clicks a shortcut, the application that is associated with the shortcut opens within a specified context. For example, you can create a shortcut to a contact so that when a user clicks the shortcut, the contacts list application opens and displays the specified contact. You could create shortcuts for a wide variety of reasons. For example, shortcuts to browser bookmarks, map location, or playlists.

You can use the following classes and interfaces to create a shortcut:

  • ShortcutProvider provides a factory method for creating shortcuts
  • Shortcut interface that encapsulates a shortcut and specifies information about the shortcut such as the icons to associate with the shortcut and the text to associate with the shortcut
  • HomeScreen provides methods to add shortcuts to the Home screen and check if shortcuts exist
  • ShortcutEventListener interface that provides methods to manage opening, changing, and deleting shortcuts
  • Location specifies where the shortcut should appear on the Home screen
  • ShortcutIconField allows you to provide users with a way to preview a shortcut's appearance on the Home screen from your application's UI
  • HomeScreenLocationPicker, provided in the net.rim.device.api.ui.picker package, allows you to create a UI field that users can use to pick where they want to add the shortcut on the Home screen (for example, a folder)

popup menu allows you to create a context menu that includes text, an application icon, and a command

The context menu is now available as a popup menu by using the new classes and interfaces available in the package. Similar to a context menu, a popup menu contains a list of the most common available actions that users can perform within the current context. An item in the popup menu can include the text, an application icon, and a command.

On BlackBerry devices with a trackpad, a popup menu appears when users click the trackpad and there is no default action.

To display a pop-up menu, pass a DefaultContextMenuProvider object into Screen.setContextMenuProvider(). If you do not provide a screen with a context menu provider, the legacy context menu is converted and displayed as a pop-up menu.

When a user invokes a pop-up menu, the DefaultContextMenuProvider looks for fields configured as CommandItemProviders. The CommandItemProvider provides CommandItems to add to the pop-up menu based on the context. The CommandItem specifies the text and icon to display in the pop-up menu, and the Command to perform when the user selects the pop-up menu item.

You can configure a field as being a CommandItemProvider by invoking Field.setCommandItemProvider().

Animation API

The Animation API is designed to make it easy for you to use animation in your BlackBerry applications.

The Animation API is implemented in the net.rim.device.api.animation package and provides the following features:
  • quick setup for common animation scenarios
  • support for scheduling animations to start in response to application and animation events
  • support for animation groups to contain and process several animations
  • support for blocking and non-blocking animation control
  • support for common and custom interpolation

Java® Binding for OpenVG™ 1.1 API

The Java Binding for OpenVG 1.1 API is new with BlackBerry Java SDK 6.0. It is designed to enable you to include high-quality 2-D vector graphics in your applications. It uses hardware acceleration to reduce power consumption while providing smooth graphics that scale fluidly.

The Java Binding for OpenVG 1.1 API is implemented in the net.rim.device.api.openvg package.


The runtime has been updated to use an accelerated OpenVG 1.1 based rendering engine resulting in new SVG Tiny™ 1.1 and 1.2 functionality, improved rendering quality and faster performance.

This change provides the following features:

  • New support improvements linear and radial gradients on fill and stroke paints.
  • Support for all stroke and fill properties
  • High quality anti-aliased path rendering.
  • High quality image rendering with including image transformations.
  • Improved smooth text rendering and functionality fill and stroke paints and arbitrary transformations.

AbsoluteFieldManager allows you to add fields at any position on the screen

You can use the net.rim.device.api.ui.container.AbsoluteFieldManager class to place fields at specific x-y positions on the screen. Rather than based on the extent of the surrounding fields, fields can be placed anywhere on the screen and can even be overlapped.

Maps API

The new Maps API is designed to improve map customization, such as adding data to a map, manipulating data, and generating static map images. The Maps API is implemented in the net.rim.device.api.lbs.maps package and subpackages and includes a new MapField class that provides the following features:

  • adding your own data to a map that is rendered directly on the map
  • panning and zooming map views
  • generating static images based on the current map view, including any data on the map

The RichMapField class that is included in the net.rim.device.lbs.maps.ui package extends the functionality of the MapField class and provides the following features:

  • adding fields on top of a map without the fields being directly rendered on the map
  • handling inactive and active focus for a MapField that is not full screen, which allows users to navigate through MapField components to other components on the screen.

pick a location from geotagged photos

You can provide a location picker in your application to select a location from a geotagged photo by using the GeotaggedPhotoPicker class that is provided in the net.rim.device.api.lbs.picker package. For example, a user can select a geotagged photo from their pictures library to see the geographical coordinates for the location. The geotagged photo location picker works only with .jpeg files that contain geotag metadata that is encoded as EXIF data. If the user selects a photo that does not contain geotag metadata, a warning dialog box displays that indicates the photo is not geotagged, and the selection is cancelled. The user can turn on the geotagging feature in the camera options of the BlackBerry® device.

Retrieve the estimated time and distance it takes to travel between two points on a given date and time

You can request the estimated travel time and distance for automobile travel to destinations in the United States and Canada by using the Travel Time API, which is provided in the package. For example, you can create an application that provides the user's current location and the estimated time of arrival to a friend's location. To retrieve the travel estimate, you must provide the geographic coordinates for the starting and ending points, and the starting time of the trip, which can be the current time or a future time. The Travel Time API uses current and historical traffic information to calculate the estimated travel time and distance.

add a location picker for favorite locations saved in BlackBerry® Maps

You can provide a location picker in your application to select locations that are saved as favorites in BlackBerry Maps. If BlackBerry Maps is available on the BlackBerry device, the location picker for BlackBerry Maps favorites is registered as a global location picker. You can retrieve registered location pickers by using the LocationPicker.getGlobalLocationPickers() method.

AutoTextlogic can be used by any input component

You can now use the logic used by AutoTextEditField in any subclass of Field.

You can use the net.rim.device.api.input.AutoTextInputHelper to provide auto-capitalization, auto-period and word auto-substitution.

disabling keyboard shortcut for switching input languages

You can use the TextField.NO_INPUT_SWITCHING constant as a parameter when creating a new instance of an input component to disable the keyboard shortcut (Alt + Enter) for switching input languages when typing in the component.

enhancements to picture scroll field

You can use the following new methods in the PictureScrollField class to enhance the look and feel and functionality of the PictureScrollField UI component:

  • setForegroundAlpha() sets focus and unfocus foreground alpha
  • setImageDistance() sets the distance between the vertical centers of two adjacent images. You can also set the image distance to be a negative value to overlap the images.
  • setPaddingImageBottom() sets the padding below the images in pixels
  • setScalingRegion() sets the distance from effects region edge to the center
  • setScrollbarVisible() sets whether or not the scroll bar visible
  • setStyle() sets the Field layout height style
  • updateImage() update the Bitmap image of ScrollEntry at index of ScrollEntry array. You can now update images at runtime.

indicate activity

The new Activity and Progress Indicator API that is provided in the net.rim.device.api.ui.component.progressindicator package allows you to display visual cues on a screen to indicate that work is being done or that a task is proceeding. You can represent an activity whose duration is unknown, as well as progress that can be represented numerically, for example, as a percentage of a completed task. The API includes two fields that are responsible for rendering the activity or progress:

  • ActivityImageField represents activity by using a bitmap that contains frames of an animation. The displayed frame changes over time. This field is built and set by ActivityView.
  • ProgressBarField represents the progress of a task as a bar that fills as the task completes. This field is built and set by ProgressView.

new table and list APIs

You can use new table and list APIs to generate dynamic tables and lists in your application.

You can use the TableModel class to create and modify a table during application runtime. You can create a new table, and add, modify or delete rows, column and their content in response to user input or events in your application.

You can use the RichListModel class to perform the same functions as the TableModel class. The RichTableModel class allows you to add other UI fields to table cells.

You can use the SimpleList or RichList class to create and modify a list during application runtime. You can create a new list, and add, modify or delete list items in response to user input or events in your application.

The SortedTableModel class supports patterned list items. You can use the DataTemplate class to create list items which follow the same format, such as items in an RSS feed.

open a context sensitive file picker for a specified file type

You can use the FilePicker.setView() method and pass in a constant to open a file selection dialog specific to a file type.

The following constants are available for this method:

  • VIEW_ALL opens a generic file selection dialog
  • VIEW_MUSIC opens file selection dialog for music files
  • VIEW_PICTURES opens a file selection dialog for picture files
  • VIEW_RINGTONES opens a file selection dialog for ringtones
  • VIEW_VIDEO opens a file selection dialog for video files
  • VIEW_VOICE_NOTES opens a file selection dialog for voice notes

Pane Manager API

You can use the new Pane Manager API to present a series of screens within your application. This control structure allows the user to switch between different screens as they are interacting with your application.

Each PaneManagerView class supports its own layout manager, TitleView, and PaneView object.

Each PaneManagerController class supports a Command object.

Each Pane class supports a title and a content Field object. The title of each pane can be any UI component supported by the device. The title can be text-only, image only, a combination of image and text, or even multirow.

Each PaneView class can display any Field as a content pane, including other Managers. The transition from pane to pane can be animated, such as horizontal movement and fading.

You can use the HorizontalScrollableTitleView and HorizontalScrollableController classes to display the title of each pane as a scrollable bar and to provide controls to switch between the panes using the trackpad and touch screen respectively. The HorizontalScrollableTitleView also provides the ability to animate the transition from pane to pane, such as fading.

Similarly, you can use the HorizontalTabTitleView and HorizontalTabController classes to display the title of each pane as a separate tab and to provide controls to switch between the panes using the trackpad and touch screen respectively. The HorizontalTabTitleView also provides the ability to animate the transition from pane to pane.

support for Thai text processing

You can use the BreakIterator class, located in the net.rim.device.api.ui.text package, to locate line and word breaks for the Thai language.

Title Bar UI component

You can use the TitleBar class in the net.rim.device.api.ui.component package to display a title bar with device information such as the application name, the time, and battery life, mail, signal strength, network, and mail indicators.

support for swipe gesture on devices with an optical jogball

Similar to touchscreen BlackBerry devices, devices with an optical jogball now support swipe gestures.

A TouchEvent object with the input event type TouchGesture.NAVIGATION_SWIPE is generated when the user swipes across the optical jogball. You can retrieve the direction of the swipe using the TouchGesture.getDirection() method.

You must add a reference to InputSettings to enable this feature by including the following code:

InputSettings inputSettings = NavigationDeviceSettings.createEmptySet();
inputSettings.set(NavigationDeviceSettings.DETECT_SWIPE, 1);

support for pinch gestures

Devices with touch screens now support pinch gestures. A pinch begins when two touch points are detected on the touch screen. A pinch's focal point is defined as the midpoint between the two initial touch points.

  • When two touch points are detected, a TouchGesture.PINCH_BEGIN event is sent. The focal point of the pinch gesture is stored as TouchEvent.getX(1) and TouchEvent.getY(1). You can access the initial zoom value by invoking TouchGesture.getPinchMagnitude().
  • as the user moves one or both touch points, a series of TouchGesture.PINCH_UPDATE events are sent. You can access the zoom values during the pinch by invoking TouchGesture.getPinchMagnitude().
  • w hen the user completes the gesture, a TouchGesture.PINCH_END event is sent. You can access the final zoom value by invoking TouchGesture.getPinchMagnitude().

By default, detection of pinch gestures is not enabled on screens. To enable pinch on a screen, set the screen property Touchscreensettings.DETECT_PINCH to 1. You can change the value of this property any time, not just when creating the screen.

Previous topic: New in this release

Was this information helpful? Send us your comments.