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 4.7

Determine if a BlackBerry device application is in touch compatibility mode

A BlackBerry device application created in the BlackBerry JDE version 4.7.0 and on a BlackBerry Storm device responds to touch events and touch gestures.

A BlackBerry device application created in the BlackBerry JDE version 4.6.0 or earlier and on a BlackBerry Storm device runs in compatibility mode and does not respond to touch events or touch gestures. You can determine if a BlackBerry device application is in compatibility mode by invoking net.rim.device.api.system.Application.isInTouchCompatibilityMode().

Set a BlackBerry device application to respond to touch events and gestures on the BlackBerry Storm device

You can set a BlackBerry device application created in the BlackBerry Java Development Environment version 4.6.0 or earlier to automatically respond to touch events and touch gestures when the application starts.

In the .jad file for a BlackBerry device application, set the the RIMTouchCompatibilityMode property to 'false'.

Allow a user to set the run mode for a BlackBerry device application on the BlackBerry Storm device

You can allow a BlackBerry® device user to manually set a BlackBerry device application to run in compatibility mode. The BlackBerry device user sets the mode through the Options screen on the BlackBerry device. In the .jad file for a BlackBerry device application, set the the RIMTouchCompatibilityMode-UserChangeable property to '’true'.

Allow a BlackBerry device application to respond to touch screen input

A BlackBerry® device application can use the net.rim.device.api.ui.TouchEvent class, the net.rim.device.api.ui.TouchGesture class, or both to support and respond to touch screen input events such as taps, swipes, and gestures from a BlackBerry device user.

Allow a MIDlet to respond to touch screen input

A MIDlet can override the Canvas.pointerPressed(), Canvas.pointerReleased(), and Canvas.pointerDragged() methods to respond to touch screen input events.

A MIDlet can also override the public void touchEvent(TouchEvent message) method in any of the BlackBerry® specific MIDP classes: BlackBerryCanvas, BlackBerryGameCanvas and BlackBerryCustomItem,to respond to touch screen input events.

Use the touch screen keyboard

A BlackBerry device application can use the net.rim.device.api.ui.container.MainScreen.getVirtualKeyboard() method with the methods of the net.rim.device.api.ui.VirtualKeyboard class to display or hide the touch screen keyboard. Use the touch screen keyboard APIs to allow a BlackBerry device application to make the touch screen keyboard available to BlackBerry device users when they wish to provide keyboard input.

Work with screen orientation

A BlackBerry device application can use the net.rim.device.api.ui.Display.getOrientation() method to retrieve the orientation of the screen. A BlackBerry device application can also use the net.rim.device.api.ui.UiEngineInstance.setAcceptableDirections(byte flags) method to set the screen direction that the application supports.

Respond to the orientation of the BlackBerry device

A BlackBerry device application can use the net.rim.device.api.system.AccelerometerSensor class to retrieve information from the accelerometer of a BlackBerry device. Use the AccelerometerSensor class to allow a BlackBerry device application to respond to changes in the orientation of the BlackBerry device.

Setting the background image of the Home screen

A BlackBerry application can invoke net.rim.blackberry.api.homescreen HomeScreen.setBackgroundImage(String uri) to set the background image of the Home screen on a BlackBerry smartphone. The image file must be located in the flash memory of the BlackBerry smartphone or the microSD card. For example, uri = "file:///store/home/user/pictures/file.jpg".

Sending and handling a camera image

A BlackBerry application can now register to handle images that a BlackBerry smartphone user sends from the camera application. After registration, when a BlackBerry Smartphone user takes a picture, a menu item appears in the menu of the camera application that allows a user to send an image to the BlackBerry application.

Invoking the video recorder

A BlackBerry application can invoke net.rim.blackberry.api.invoke. Invoke.invokeApplication(Invoke.APP_TYPE_CAMERA,new CameraArguments(CameraArguments.ARG_VIDEO_RECORDER) to start the video recorder application.

Audio and video support on the BlackBerry Storm device

The BlackBerry Storm device supports audio recording and the playback of audio and video.

Support for audio recording:

  • GSM 6.10
  • QCELP
  • AMR-NB

Support for audio playback:

  • PCM, uLaw/aLaw and GSM 6.10 in WAV format
  • AAC/AAC+/eAAC+ in M4A and AAC formats
  • MP3
  • MIDI
  • WMA
  • AMR-NB

Support for Video playback:

  • MPEG 4-SP in an AVI format
  • MPEG 4-SP and H.263 in MP4, 3GP and MOV formats
  • WMV

Displaying the music library in the media player

A BlackBerry device application can use the javax.microedition.content.Invocation class and the net.rim.device.api.content.BlackBerryContentHandler class to start the media application and view the music library.

Launching a BlackBerry device application from the Music player or the Music library Screen

A BlackBerry device application can use the net.rim.blackberry.api.menuitem.ApplicationMenuItem and net.rim.blackberry.api.menuitem.ApplicationMenuItemRepository classes to add links to the music player and the music library. A BlackBerry device user can select the links to launch the BlackBerry device application.

Retrieve the browser user agent

A BlackBerry device application can invoke java.lang.System.getProperty(“browser.useragent”) to retrieve the browser user agent from the Browser.

BlackBerry Storm device memory

On the BlackBerry Storm device, the content store memory that a BlackBerry device application accesses through the File Connection API has no limit for individual file sizes.

Default menu now includes system menu items

The default menu for an application Screen now includes system menu items.