J2ME must service many different kinds of small computing devices, including screen phones, digital set-top boxes used for cable television, cell phones, and Personal Digital Assistants.
This issue has been resolved by introducing a two-fold approach of introducing configuration and profiles in J2ME:
- Configuration defines the Java run-time environment and core classes that operate on each device. It defines the Java Virtual Machine for a particular small computing device.
- Profile consists of classes that enable developers to implement features found on a related group of small computing devices.
J2ME Configurations
There are two different configurations for J2ME:
- Connected Limited Device Configuration (CLDC) and
- Connected Device Configuration (CDC)
- CLDC devices usually have between 160KB and 512KB of available memory and are battery powered.
- They also use an inconsistent, small-bandwidth network wireless connection and may not have a user interface.
- CLDC devices use the KJava Virtual Machine (KVM) implementation, which is a stripped-down version of the JVM.
- CLDC devices include pagers, personal digital assistants, cell phones, dedicated terminals, and handheld consumer devices with between 128KB and 512KB of memory.
- They use a 32-bit architecture
- They have at least two megabytes of memory available, and implement a complete functional JVM.
- CDC devices include digital set-top boxes, home appliances, navigation systems, point-of-sale terminals, and smart phones.
J2ME Profile
A profile consists of Java classes that enable implementation of features for either a particular small computing device or for a class of small computing devices. There are seven profiles have been defined in J2ME, namely Foundation Profile, Game Profile, Mobile Information Device Profile, PDA Profile, Personal Profile, Personal Basis Profile, and RMI Profile.
- The Foundation Profile is used with the CDC configuration and is the core for nearly all other profiles used with the CDC configuration because the Foundation Profile contains core Java classes.
- The Game Profile is also used with the CDC configuration and contains the necessary classes for developing game applications for any small computing device that uses the CDC configuration.
- The Mobile Information Device Profile (MIDP) is used with the CLDC configuration and contains classes that provide local storage, a user interface, and networking capabilities to an application that runs on a mobile computing device such as Palm OS devices. MIDP is used with wireless Java applications.
- The PDA Profile (PDAP) is used with the CLDC configuration and contains classes that utilize sophisticated resources found on personal digital assistants. These features include better displays and larger memory than similar resources found on MIDP mobile devices (such as cell phones).
- The Personal Profile is used with the CDC configuration and the Foundation Profile and contains classes to implement a complex user interface. The Foundation Profile provides core classes, and the Personal Profiles provide classes to implement
a sophisticated user interface, which is a user interface that is capable of displaying multiple windows at a time. - The Personal Basis Profile is similar to the Personal Profile in that it is used with the CDC configuration and the Foundation Profile. However, the Personal Basis Profile provides classes to implement a simple user interface, which is a user interface that is capable of displaying one window at a time.
- The RMI Profile is used with the CDC configuration and the Foundation Profile to provide Remote Method Invocation classes to the core classes contained in the Foundation Profile
Small Computing Device Requirements
The following are the minimum resource requirements for a small computing device to run a J2ME application:
- First the device must have a minimum of 96 × 54 pixel display that can handle bitmapped graphics and have a way for users to input information, such as a keypad, keyboard, or touch screen.
- At least 128 kilobytes (KB) of nonvolatile memory is necessary to run Mobile Information Device (MID), and 8KB of nonvolatile memory is needed for storage of persistent application data.
- To run JVM, 32KB of volatile memory must be available.
- The device must also provide two-way network connectivity.
Besides minimal hardware requirements, there are also minimal requirements for the native operating system:
- The native operating system must support exception handling, process interrupts, be able to run the JVM, and provide schedule capabilities.
- All user input to the operating system must be forwarded to the JVM, otherwise the device cannot run a J2ME application.
- The native OS must be able to write and read persistent data (data retained when the device is powered down) to nonvolatile memory.