The net.rim.device.api.ui package contains the fundamental classes that are used for all UI applications:
- Field: A rectangular area that can be drawn on the screen of a device.
- Manager: An area that contains other UI components and handles layout and scrolling behavior.
- Screen: A drawable area that is pushed on to and popped off of an application's display stack.
For convenience, the net.rim.device.api.ui.component package contains prebuilt UI components such as the following:
- ButtonField: A simple button.
- DateField: A field that contains date and time values.
- LabelField: A text label.
- TextField: An editable text field.
For more information about the classes in the net.rim.device.api.ui.component package, see UI components.
The net.rim.device.api.ui.container package contains classes that you can use to arrange UI components on a screen, such as:
- FlowFieldManager: A manager that arranges fields horizontally and then vertically.
- HorizontalFieldManager: A manager that arranges fields in a single horizontal row.
- VerticalFieldManager: A manager that arranges fields in a single vertical column.
You can use the SVG APIs, which are included in the org.w3c.dom package and the net.rim.plazmic.mediaengine package, to draw 2-D graphics in your applications. SVG is a text-based markup language, similar to HTML, that represents 2-D vector graphics, animation, and interactivity. Vector graphics rely on primitive geometric objects, such as lines, circles, and polygons. Because they are based on geometry, vector graphics can be manipulated easily without loss of accuracy. For example, SVG automatically scales objects based on the screen resolution of a device. SVG support was added to Java ME with JSR 226. You can use SVG in both MIDlets and BlackBerry Java applications.
There are two ways to use SVG in your applications on a BlackBerry device:
- For BlackBerry Java SDK 4.6 and later, you can use SVG directly by using the classes and interfaces in the org.w3c.dom, org.w3c.dom.events, and org.w3c.dom.svg packages.
- For BlackBerry Java SDK 4.5 and earlier, you can use .pme files as binary representations of SVG content by using the net.rim.plazmic.mediaengine and net.rim.plazmic.mediaengine.io packages. With .pme files, you can test content using the media engine simulator or the BlackBerry Smartphone Simulator, and view content on a BlackBerry device.
You can use the Graphics Utility API, which is included in the net.rim.device.api.openvg and net.rim.device.api.opengles packages, to develop applications using OpenVG and OpenGL ES. OpenVG and OpenGL ES are graphics libraries that are designed to work closely with graphic display hardware to produce high-quality 2-D and 3-D graphics on BlackBerry devices. Applications that you create using these APIs can run only on BlackBerry devices, and cannot run on other mobile devices.
You can use the MIDP and CLDC APIs, which are included in the javax.microedition.lcdui package, to create UIs for your applications. Applications created with these APIs are called MIDlets. The BlackBerry Java SDK supports MIDP 1.0 (JSR 37) and MIDP 2.1 (JSR 118).
MIDlets provide the advantage of running on other devices that support Java ME, but they are not optimized for BlackBerry screens or functionality, and so are not suitable for creating quality apps.