The APIs available to a MIDP application come from packages in both the CLDC and the MIDP, as shown in Figure 1-2.
Figure 1-2: MIDP packages
The 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. The CLDC also specifies a generalized network API in javax.microedition.io.
Optionally, device vendors may also supply Java APIs to access device-specific features. MIDs, then, will typically be able to run several different flavors of applications. Figure 1-3 shows a map of the possibilities.
Figure 1-3: MID software components
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.
Team-Fly |