Introduction To J2ME - Online Article

Developers seeking to build applications that run on cell phones, personal digital assistants, and various consumer and industrial appliances must strike a balance between a thick client and a thin client. A thick client is front-end software that contains the logic to handle a sizable amount of data processing for the system. A thin client is front-end software that depends on back-end software for much of the system processing.

A key benefit of using J2ME is that J2ME is compatible with all Java-enabled devices.

The challenge for the Java Community Process Program is to develop a Java standard that can be implemented on small computing devices that have nonstandard hardware configurations.

The Java Community Process Program has used a twofold approach to addressing the needs of small computing devices. First, they defined the Java run-time environment and core classes that operate on each device. This is referred to as the configuration. A configuration defines the Java Virtual Machine for a particular small computing device. There are two configurations, one for handheld devices and the other for plug-in devices. Next, the Java Community Process Program defined a profile for categories of small computing devices. A profile consists of lasses that enable developers to implement features found on a related group of small computing devices.

J2ME Configurations

There are two configurations for J2ME as of this writing. These are Connected Limited Device Configuration (CLDC) and the Connected Device Configuration (CDC).

The CLDC is designed for 16-bit or 32-bit small computing devices with limited amounts of memory. CDC devices use a 32-bit architecture.
CLDC devices usually have between 160KB and 512KB of available memory and are battery powered. 128 kilobytes memory for running Java. 32 kilobytes memory for runtime memory allocation Have at least two megabytes of memory available. 512 kilobytes (minimum) memory for running Java. 256 kilobytes (minimum) for runtime memory allocation
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. Implements a complete functional JVM.
CLDC devices include pagers, personal digital assistants, cell phones, dedicated terminals. Restricted user interface Low power, typically battery powered, Network connectivity, typically wireless, with low bandwidth and intermittent access CDC devices include digital set-top boxes, home appliances, navigation systems, point-of-sale terminals, and smart phones.Network connectivity, possibly persistent and high bandwidth.

J2ME Profiles

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. Seven profiles have been defined as of this writing. These are The 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.

The whole caboodle-configuration, profile, and optional APIs-that is implemented on a device is called a stack.

The JAVA Community Process

The Java Community Process (JCP) is designed to ensure that Java technology is developed according to community consensus, and to avoid industry fragmentation. The process is described here:

Configurations and profiles first appear in the world as Java Specification Requests (JSRs). You can see a list of current JSRs here:

CDC is developed under the Java Community Process. For more information on the CDC, see

The Wireless Application Protocol (WAP) forum became the initial industry group that set out to create standards for wireless technology. The WAP standard is an enhancement of HTML, XML, and TCP/IP. The WAP standard also includes specifications for a Wireless Telephony Application Interface (WTAI) specification and the WML Script specification. WTAI is used to create an interface for applications that run on a mobile communications device. WML Script is a stripped-down version of JavaScript.

  • J2ME applications referred to as a MIDlet can run on practically any mobile communications device that implements a JVM and MIDP.
  • J2ME isn't seen as a replacement for the WAP specification because both are complementary technologies.
  • Developers whose applications are light-client based continue to use WML and WML Script. Developers turn to J2ME for heavier clients that require sophisticated processing on the mobile communications device.
  • A MIDlet is not invoked the same way as a J2SE application is invoked because many small computing devices don't have a command prompt. MIDlets are controlled by application management software (AMS).
  • AMS interacts with native operations of a small computing device and controls the life cycle of a MIDlet. The life cycle consists of installation and upgrades as well as version management and uninstalling the application. Likewise, AMS is responsible for starting, managing execution, and stopping the MIDlet.
  • Ant provides considerable flexibility in structuring your build cycle and lets you easily automate tasks like generating documentation or packaging source code. For an introduction to Ant and MIDP, see

Many small computing devices and mobile communications devices use radio waves and light waves to transmit and receive information. Radio waves are used by cellular telephones, wireless modems, and wireless personal digital assistants (PDAs) for communication. Infrared light waves are used by PDAs to exchange information between PDAs and laptop/desktop computers and among other PDAs. Radio signals are transmitted in the frequency range from 10 kilohertz to 300,000 megahertz. A hertz is one wave per second, kilohertz is 1,000 waves per second, and a megahertz is a million waves per second.

Before moving further take a look at some of the basics.


For CDC, the virtual machine has the same specification as J2SE. For CLDC, Sun has developed what is referred to as a reference implementation of a virtual machine, known as the K (kilo) Virtual Machine, or simply KVM. This virtual machine was designed to handle the special considerations of resource constrained devices. It's clear the KVM is not the "traditional" Java virtual machine:

  • The virtual machine itself requires only 40 and 80 kilobytes of memory
  • Only 20-40 kilobytes of dynamic memory (heap) are required
  • Can run on 16-bit processors clocked at only 25 MHz
  • Sun's reference implementation of the KVM is written in C to facilitate portability

Running on a Real Device

As of this writing, millions of MIDP-enabled phones are deployed worldwide. A comprehensive list of MIDP devices is available at How do you actually put MIDlets on a device? There are two possibilities: either you'll transfer MIDlet suites to the phone from your computer via a serial cable, or you'll transfer MIDlet suites over the wireless network. (Another possibility serves as a hybrid-a device in its cradle, attached to your computer via a serial cable, can use the desktop computer's network connection as though it was a wireless connection, and applications can be transferred this way.) This second possibility is called over the air (OTA) provisioning. There's a standard protocol for OTA, which is described as an addendum to the MIDP 1.0 specification. (The OTA addendum is included in the MIDP 2.0 specifications.)

Installing MIDlets via serial cable or OTA provisioning is specific to whatever device you're using. You'll have to check the documentation for your device to see exactly how to install MIDlet suites.

About the Author:

No further information.


No comment yet. Be the first to post a comment.