The MIDP Java Platform
The Java platform available to MIDlets is that provided by CLDC as
described in Chapter 2, together with a collection
of MIDP-specific packages arranged under the
javax.microedition package hierarchy. The core
libraries themselves are almost unaffected by the MIDP specification;
the only change is the addition of the J2SE 1.3 timer facility in the
java.util package, which will be covered in Section 3.5.4. The
MIDP specification also places the following requirements on the core
libraries:
Like applets, MIDlets are managed in an execution environment that is slightly different from that of a Java application. As you’ll see shortly, the initial entry point to a MIDlet is not the
main( )method of its MIDlet class, and the MIDlet is not allowed to cause the termination of the Java VM. In order to enforce this restriction, theexit( )methods in both theSystemandRuntimeclasses are required to throw aSecurityExceptionif they are invoked.In addition to the system properties defined by CLDC, MIDP devices must set the
microedition.localeproperty to reflect the locale in which the device is operating. The locale names are formed in a slightly different way from those used by J2SE, because the language and country components are separated by a hyphen instead of an underscore character. A typical value for this property would been-USon a MIDP device, whereas a J2SE developer would expect the locale name in the formen_US. Since both MIDP and CLDC provide almost ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access