Sorry about the red box, but we really need you to update your browser. Read this excellent article if you're wondering why we are no longer supporting this browser version. Go to Browse Happy for browser suggestions and how to update.

BlackBerry Java SDK 5.0

User interface

Item

Description

autocomplete text field

You can allow users to search for items by creating an autocomplete text field using the AutoCompleteField class in the net.rim.device.api.ui.component package. You can create an autocomplete text field to display a field on the screen of the BlackBerry device. As the user types search criteria in the field, the AutoCompleteField displays items that match the search criteria. You can specify the data on the BlackBerry device that the search string is compared against. For example, you can create an autocomplete text field that allows a user to search for a contact on the BlackBerry device by typing the name or birthday of the contact. You can specify the information that you display to the user as matches occur. For example, you can display the name, phone number, and email address of contacts in the search results.

bitmap scaling and image comparison

You can scale a Bitmap by using the net.rim.device.api.system.Bitmap.scaleInto(Bitmap, int) method. The scaling factor is based on the size of the Bitmap image that is passed as a parameter. The result is stored in the passed Bitmap image.

You can compare the current Bitmap image to another Bitmap image by using the Bitmap.locateDifference() method in the net.rim.device.api.system package.

date and time picker

You can allow users to choose a day, month, year, or time by creating a date and time picker using the DateTimePicker class in the net.rim.device.api.ui.picker package. For example, you can allow users to choose a month and year to specify when their credit card expires. A user can choose a value for the date or time by using the keyboard, rolling the trackball, or sliding a finger across the screen on the BlackBerry device.

eyelid field

You can display fields on a pair of managers that appear on the top and bottom of a screen by creating an eyelid field using the EyelidFieldManager class in the net.rim.device.api.ui.extension.container package. For example, you can place buttons on an eyelid field. The user can move the trackball to see them on the screen.

file picker

You can allow users to navigate to files on the BlackBerry device by creating a file picker using the FilePicker class in the net.rim.device.api.ui.picker package. For example, you can allow users to search for a document on the BlackBerry device or on a media card.

font customization

You can install fonts on and remove fonts from a BlackBerry device by using the net.rim.device.api.ui.FontManager class. For example, you can install a font on a BlackBerry device, use the font in your application, and allow other applications to use the font.

grid layouts

You can position fields in rows and columns on a screen to create a grid by using the GridFieldManager class. After you create a grid, you can add fields, delete fields, and specify the grid's properties.

image creation

You can add an image to your application from a bitmap file or encoded image file by using the Image API in the net.rim.device.api.ui.image package. For example, you can use the Image API to add a .gif file to your application.

image zooming and panning

You can allow users to zoom into and pan an image by using the ZoomScreen class. When a user clicks the trackball or touch screen, the BlackBerry device zooms into the center of the image. To pan the image, the user zooms into the image, and then rolls the trackball or slides a finger across the screen. To zoom out, the user presses the Escape key.

location to add your application to on a BlackBerry device

You can add your BlackBerry device application to one of the application folders that is available with the theme on the BlackBerry device, to a new application folder that you create, or to the Home screen on the BlackBerry device by changing the application's .jad file. For example, if you develop a game, you can add your game to the Games folder on the BlackBerry device. If you do not specify a location, the BlackBerry device adds your application to the default application folder (for example, the Downloads application folder). You can specify the location of applications that are installed on a BlackBerry device that is running BlackBerry Device Software version 5.0 or later.

For more information, visit www.blackberry.com/go/devguides to read the BlackBerry Java Application Core Development Guide.

location picker

You can allow users to choose a location from a list that you define by creating a location picker using the LocationPicker class in the net.rim.device.api.lbs.picker package. For example, you can allow users to choose their GPS location or a previously selected location.

menu customization

You can customize a menu in your BlackBerry device application.

  • You can specify a custom background, border, and font for a menu in your application by using the Menu class in the net.rim.device.api.ui.component package.
  • You can add an icon to a menu item in your BlackBerry device application by using the MenuItem class in the net.rim.device.api.ui package.

MIDP 2.1 support

MIDP 2.1 is supported in this release.

picture scrolling

You can display a row of images on a BlackBerry device that a user can scroll through by using the PictureScrollField class in the net.rim.device.api.ui.extension.component package. Users can scroll through the images by rolling the trackball, pressing shortcut keys, or, on BlackBerry devices with a touch screen, sliding a finger across the screen. For example, you can create a PictureScrollField to allow a user to navigate through images on the BlackBerry device, and display a caption and tooltip about each image.

screen transitions

You can apply a visual effect that appears when your application opens or closes a screen on a BlackBerry device by using the TransitionContext class in the net.rim.device.api.ui package. For example, you can reveal a new screen that your application opens by sliding it onto the display on the BlackBerry device. After you create a screen transition, you must register it within your application, specify the outgoing and incoming screens, the events that cause the transition to occur, and the transition to display using new methods available in the net.rim.device.api.ui.UiEngineInstance class.

support for JSR 239 and OpenGL ES

You can create rich 2-D and 3-D graphics for a BlackBerry device using JSR 239 and BlackBerry APIs. JSR 239 contains the Java binding for OpenGL ES 1.0 and 1.1. The following packages are included in this release:

  • javax.microedition.khronos.opengles provides bindings for OpenGL ES 1.0, 1.1, and extensions
  • javax.microedition.khronos.egl provides bindings for EGL 1.0 and 1.1 for the OpenGL ES API
  • net.rim.device.api.opengles provides additional functionality for the BlackBerry device
  • java.nio provides the ability to read and write high-speed block I/O
  • net.rim.device.api.math provides 2-D and 3-D math classes

spin box field

You can allow users to choose an item from an ordered list by creating a spin box using the SpinBoxField class in the net.rim.device.api.ui.component package. For example, use spin boxes to allow users to find a number or to change the day of the week.

Network API

Item

Description

enhanced Network API

You can specify how your application makes a connection to a network by using the enhanced Network API available in the net.rim.device.api.io.transport and net.rim.device.api.io.transport.options packages. For example, you can use the enhanced Network API to determine the availability and coverage of a Wi-Fi network that your application can use to open an HTTP connection. If the Network API determines that there is a Wi-Fi network available and there is sufficient coverage, the Network API connects to the Wi-Fi network.

You can specify a preferred list of transport types. For example, if a Wi-Fi network is not available or does not have sufficient coverage, you can specify that the Network API check other transport types, such as a cellular network. If you do not specify a transport type, the BlackBerry device tries all available transport types.

Hotspot API

You can create an application that helps users connect to hotspots, by using the Hotspot API that is provided in the net.rim.device.api.wlan.hotspot package. Your application can interact with the Wi-Fi transceiver on a Wi-Fi enabled BlackBerry device, and the application that users use to manage a connection to a Wi-Fi network .

Previously, to connect to a hotspot a user completed multiple tasks. Now, to automate the process of associating and authenticating a user to a hotspot you can use the Hotspot API to create an application that performs the following functions:

  • automatically associate a Wi-Fi profile on the device, with a hotspot
  • automatically log in users to a hotspot
  • store a user's hotspot login information on the device
  • integrate with the setup wizard and the Wi-Fi profiles that users use to manage a connection to a Wi-Fi network

support for the Push Service SDK on a BlackBerry device

You can implement the features of the on a BlackBerry device by using the Push API that is provided in the net.rim.blackberry.api.push package. The Push API enables you to create a push application that can perform the following functions:

  • register your application with the Push Service
  • listen for push notifications sent to the BlackBerry device
  • start your application when the BlackBerry device receives a push notification from your application
  • send a notification after a specified event occurs on the BlackBerry device (for example, after a user changes the SIM card in the BlackBerry device)
  • send a notification when a user removes your application from the BlackBerry device

For more information about the Push Service SDK, see www.blackberry.com/developers/pushservice. For more information about the Push API, see the API reference for the BlackBerry Java Development Environment.

Utilities

Item

Description

Enhancements for string comparisons

The StringUtilities.compareToHandleSpecialChars() method can be used to do a case-insensitive comparison of two strings that handles special characters differently than strict ASCII order. This method replaces StringUtilities.compareToOutlookOrder().

Integration

Item

Description

additional PIM list support

The following PIM list features are now available:

  • You can access a PIM list by its UID by invoking BlackBerryPIM.openPIMList() in the net.rim.blackberry.api.pdap package. You might want to reference a PIM list by its UID instead of its name because a UID does not change.
  • You can access multiple contact lists on the BlackBerry device by using the PIM class in the javax.microedition.pim package.
  • You can work with wireless synchronization and the size of a contact list by using new methods available in the BlackBerryPIMList class.

advanced multimedia supplements

The Advanced Multimedia Supplements of JSR 234 for just the camera and video enhancements are now supported and accessed through javax.microedition.amms. The Advanced Multimedia Supplements add many new controls for advanced camera and video features.

automatic download of email attachments

You can manage attachments to incoming and outgoing email messages on a BlackBerry device by using the APIs in the net.rim.blackberry.api.mail package. For example, when messages are received on the BlackBerry device, you can automatically download attachments to email messages in the background.

BlackBerry extension to JSR 179

You can access location information about a BlackBerry device by using the BlackBerry extension to JSR 179 that is available in the net.rim.device.api.gps package. You can use the BlackBerry extension to JSR 179 on BlackBerry devices that run BlackBerry Device Software version 5.0 or later.

The JSR179 Extension provides the following extensions to JSR179:
  • BlackBerryCriteria class
  • BlackBerryLocation class
  • BlackBerryLocationProvider class

The BlackBerryCriteria class extends the Criteria class and permits you to specify the following information:

  • initial GPS mode
  • failover GPS mode, if applicable
  • GPS mode to use after your application obtains a GPS fix
  • specify whether GPS satellite information before and after a GPS is required

The BlackBerryLocation class extends the Location class and permits you to retrieve the following information:

  • GPS satellite information (for example, the number of GPS satellites, the average signal quality, and details about the GPS satellites)
  • data source that obtains the GPS fix
  • GPS mode that provides the GPS location information
  • Get the GPS failure reason, if any

The BlackBerryLocationProvider class extends the LocationProvider class and permits you to perform the following actions:

  • process a GPS location request from a BlackBerryCriteria object
  • pause and resume a location listener
  • retrieve the GPS provider type (for example, an internal GPS receiver or a Bluetooth enabled GPS receiver)
  • get GPS feedback (other than a GPS fix). Feedback includes satellite information before a GPS fix, indication that a failover mode has occurred and also indication when the implementation is using a different GPS mode after the first mode has successfully produced a fix.

For more information about the BlackBerry extension to JSR 179, visit www.blackberry.com/go/devguides to read the BlackBerry Java Application Location-Based Services Development Guide.

biometric recognition and authentication

You can store, manage, and retrieve fingerprint and biometric information on a BlackBerry device by using the Biometric API available in the net.rim.device.api.biometrics package and methods available in the SmartCard and SmartCardSession classes. For example, you can extract fingerprint information from a smart card to match against a scanned fingerprint.

enhanced media key events

You can have your application listen for events that are triggered when media keys are pressed by using the MediaActionHandler class in the net.rim.device.api.media package. You can use the MediaKeyListener class to receive all key events when the application is in the foreground, and receive unhandled global keys when the application is in the background. For example, you can allow a user to control media playback using certain keys while another application is in the foreground.

You can assign media key events to keys on a BlackBerry device for actions such as increasing the volume, decreasing the volume, and moving forward and back through audio and video files by using the Keypad class in the net.rim.device.api.ui package.

landmark information retrieval using geocoding and reverse geocoding

You can retrieve landmark information by invoking Locator.geocode() and Locator.reverseGeocode() in the net.rim.device.api.lbs package. For example, you can search for known landmark information by using a street address, city, or postal code. You can use reverse geocoding to find an approximate address based on latitudinal and longitudinal coordinates.

linking contacts

You can link a contact in your application with a contact in the contacts application on the BlackBerry device by using the classes and interfaces in the net.rim.blackberry.api.pdap.contactlinking package. For example, you can allow users to link a contact in your CRM application with a contact in the contacts application on the BlackBerry device.

MEID retrieval

You can retrieve the MEID number for BlackBerry devices that operate on a CDMA network using the CDMAInfo.getHexMEID() and CDMAInfo.getDecimalMEID() methods available in the net.rim.device.api.system. package.

multi-line phone support

You can create an application that interacts with the phone lines available (for example, a cellular line and a work line) on a BlackBerry device by using the Phone and MultiLineListener classes in the net.rim.blackberry.api.phone package. For example, you can create an application that determines the types of phone lines available on a BlackBerry device and starts outgoing calls using a specific phone line.

The new Multi-line API provides the following features:

  • retrieve the phone numbers and labels, IDs, and WAFs of available lines
  • determine whether a phone line is a cellular line or a work line
  • invoke the phone application using a source line and destination number

multiple contact list support

You can now access individual contact lists available on a BlackBerry device by using the PIM class in the javax.microedition.pim package.

phone screen content

You can listen for incoming or outgoing calls and display information about incoming and outgoing calls on the phone screen by using the PhoneScreen class in the net.rim.blackberry.api.phone.phonegui package. For example, when a contact on a BlackBerry device calls a user, you can display specific information about the contact on the phone screen on the BlackBerry device.

Further enhancements have been made to the net.rim.blackberry.api.phone.Phone and net.rim.blackberry.api.phone.MultiLineListener classes.

random file access

You can read data from and write data to a file at any location within the file using the Random File Access API. A new Seekable interface is provided in the net.rim.device.api.io package.

support for reading contact names in Japanese

You can now access the Japanese reading of the NAME_GIVEN and NAME_FAMILY elements of the NAME and ORG fields by using the net.rim.blackberry.api.pdap.BlackBerryContact interface. You can access this information by using the NAME_GIVEN_YOMI and NAME_FAMILY_YOMI indices of the NAMEString array field's value, and the new ORG_YOMI field.

touch event injection

On BlackBerry devices with touch screens, you can inject touch events, such as swipes and taps, by using the EventInjector.TouchEvent class. For example, you can use touch event injection to automate the testing of your application or provide a way for peripherals to interact with a BlackBerry device.

user authentication modules

You can create a module that you can use to authenticate users by using the net.rim.device.api.userauthenticator package. For example, you can create a module that authenticates a user to the BlackBerry device by using a smart card or biometric reader.

video capture and play

You can embed a viewfinder, record video clips, and play captured video by using JSR 135. When your BlackBerry device application records to a file, the Player records in 3GP format. When your application records to an OutputStream, the Player records in a proprietary streaming video format.

You can retrieve and control a video viewfinder, and record the video shown in the viewfinder by using the VideoControl and RecordControl controls. The Player records to a file specified by a file locator or to an OutputStream. A new Player must be created to display the recorded video.

SQLite support

BlackBerry devices that run BlackBerry Device Software version 5.0 or later have the SQLite library integrated into the operating system and virtual machine. You can develop applications that use the integrated SQLite database using the SQLite API. You can use the SQLite API to store application data. Like the Persistent Store API or the MIDP RMS API, the SQLite API enables you to store data persistently to an eMMC or a microSD card. The SQLite API provides the option to store data in an encrypted format using the same mechanisms as the Persistent Store APIs.

Debugging and refining code

On-device profiling: You can use the BlackBerry Integrated Development Environment to retrieve profiling data from a BlackBerry device that has been attached to the BlackBerry Integrated Development Environment. This feature has been supported since BlackBerry JDE 4.6.1.

BlackBerry Smartphone Simulator hot swap: You can make changes to your source code while the BlackBerry Smartphone Simulator is running and then view the changes live in the BlackBerry Smartphone Simulator.