CLDC Profiles

CLDC itself provides only a basic set of classes for a J2ME profile. In Chapter 1, you were given an overview of the two profiles available for CLDC: the Mobile Information Device Profile (MIDP) and the PDA Profile (PDAP). Now, we will present the additional functionality the profiles add to CLDC. We will start with MIDP and then give an overview of PDAP. Figure 2.1 shows an overview of the J2ME CLDC packages and their intersections with J2SE.

Figure 2.1. J2ME CLDC packages including the MID and PDA profiles and intersections with J2SE.


MID Profile

As described in Chapter 1, MIDP is designed for mobile information devices such as cellular phones and two-way pagers. MIDP adds several new packages and classes to CLDC. The following sections list the additions per package.

Additions to java.util

MIDP adds the classes Timer and TimerTask in the package java.lang to the set of supported classes. Timer and TimerTask allow simplified scheduling of tasks for a point of time in the future, including repeated tasks.

Additions to java.lang

MIDP adds the IllegalStateException in the package java.lang. The IllegalStateException is thrown when a method is called in a state of the application where doing so is not allowed. For example, you can't access the display of a MIDlet before the corresponding startApp() method is invoked by the system.

Additions to javax.microedition.io

MIDP adds an HttpConnection for HTTP connections to the generic connection framework. The HttpConnection class is described in detail in Chapter 6.

Package javax.microedition.midlet

The javax.microedition.midlet package is a completely new package of MIDP. It mainly contains the class MIDlet, encapsulating the life cycle of an MIDP application. The MIDlet class can be compared to an applet to some extent, except that it is not related to the display. The life cycle of MIDP applications—including the MIDlet class—is described in detail in Chapter 3.

Package javax.microedition.lcdui

The javax.microedition.lcdui package contains the graphical user interface (GUI) classes for MIDP. These classes are not compatible to J2SE and provide only very basic elements adequate to the limited display of a mobile information device. The MIDP GUI classes are described in detail in Chapter 3, together with the MIDP application life cycle.

Package javax.microedition.rms

MIDP does not contain a file system, but instead uses a record management API for persistent storage. The record system is more adequate to the persistent memory of mobile devices, where data is usually stored persistently in random access memory instead of sequential files. The record management system is described in detail in Chapter 5, “Data Persistency.”

PDA Profile

Like the MID Profile, the PDA Profile makes many additions to the CLD Configuration required for the targeted class of devices. Because PDAP is a superset of MIDP, all MIDP packages and CLDC additions are available in PDAP. Please note that PDAP 1.0 is based on CLDC 1.1, in contrast to MIDP 1.0, which is based on CLDC 1.0.

In addition to the MIDP additions to CLDC, PDAP provides a more sophisticated user interface based on a subset of the Abstract Window Toolkit (AWT) and access to the device address and calendar databases.

Package java.awt and Subpackages

In contrast to MIDP, PDAP does not provide a user interface API designed from scratch. The PDAP user interface is a subset of the J2SE AWT classes.

Package javax.microedition.pim

The personal information management classes provide access to the built-in calendar and address book databases of the PDA. The pim classes are described in detail in Chapter 7, “PIM: Accessing the Personal Information Manager.”

Additions to javax.microedition.io

PDAP adds a CommConnection and a FileConnection for serial port and file access to the generic connection framework, which are described in detail in Chapter 6.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset