The JavaTM ME platform differs to some extent from the Java SE and Java EE platforms. The following list describes some of these differences:
Accessing native application data
Accessing native S60 Symbian OS or Series 40 Nokia OS application data is restricted in mobile Java. However, using the optional FileConnection and PIM APIs (JSR-75) allows you some access to native data.
Class loading
CLDC does not support application defined class loading. Also note that Java ME has no mechanism to unload classes. All classes loaded during the running of a MIDlet will occupy the heap for the lifetime of the MIDlet. This applies to both MIDlet classes and the platform's API classes.
Virtual machine
The Virtual Machine of S60 and Series 40 platforms is a subset of the features of the higher end Java Virtual Machine (JVM). It is designed for embedded devices and has a smaller memory footprint.
Floating point numbers
The CLDC 1.1 configuration supports floating-point numbers. Note, however, that there are also some older devices based on the CLDC 1.0 configuration, which do not support floating-point numbers. In this case, applications cannot use floating point types such as floats or doubles. Floating-point-type calculations can still be made, but the results have to be stored in a string or as an integer array.
Preverification
MIDP applications have to be preverified before runtime. CLDC does not support a full Java SE type bytecode verifier, but instead a different kind of bytecode verifier that takes less memory in the device, but requires application class files to be preverified during application development, more specifically in the compile process.
Finalization
CLDC does not support finalization (the finalize()
method).
Java Native Interface (JNI)
CLDC does not support Java Native Interface (JNI) and therefore it is not possible to extend Java APIs beyond those that come with the device.
Reflection
Java ME does not support reflection. In addition, Java ME does not support object serialization or Remote Method Invocation (RMI).
Error handling
Java ME has different requirements for error handling. For more information on errors, see the Java tutorial Handling Errors Using Exceptions.
High-level APIs
MIDP 2.0/2.1 does not support large user interface APIs such as Swing and AWT. Instead, MIDP implements LCDUI, which takes into account the capabilities of mobile devices.
File handling
CLDC does not support file access, but using FileConnection API (JSR-75) allows you to access the file system.
No thread groups or daemon threads
Although multithreading is possible with MIDP, it does not support thread groups or daemon threads. However, thread groups can be created at the application level by using a collection to store the thread objects.