The APIs available to a MIDP application come from packages in both CLDC and MIDP, as shown in Figure 1-2. Packages marked with a + are new in CLDC 1.1 and MIDP 2.0.
CLDC defines a core of APIs, mostly taken from the J2SE world. These include fundamental language classes in java.lang, stream classes from java.io, and simple collections from java.util. CLDC also specifies a generalized network API in javax.microedition.io.
| Note?/td> |
According to the MIDP 2.0 specification, MIDP 2.0 will most likely be paired with CLDC 1.1, although it is certainly possible for MIDP 2.0 to be implemented atop CLDC 1.0. The first implementations of MIDP 2.0 will be paired with CLDC 1.0, as the MIDP 2.0 specification is further along in the Java Community Process than the CLDC 1.1 specification. |
Optionally, device vendors may also supply Java APIs to access device-specific features. MIDP devices, then, will typically be able to run several different flavors of applications. Figure 1-3 shows a map of the possibilities.
Each device implements some kind of operating system (OS). Native applications run directly on this layer and represent the world as it is today—many different kinds of devices, each with its own OS and native applications.
Layered on top of the device OS is the CLDC (including the KVM) and the MIDP APIs. MIDP applications use only the CLDC and MIDP APIs. Device-specific Java applications may also use Java APIs supplied by the device vendor.