Introduction Mobile Information Device Profile(MIDP)

Post date: Mar 3, 2011 4:52:23 AM

Mobile Information Device Emulators

Sun Microsystems provides two reference implementations of MIDP. These software packages are

available for developers to use as a testing ground, and also provide device manufacturers with a

model, or starting point, for creating an implementation of MIDP for a device(s).

The implementations available from Sun are:

    • MIDP and CLDC as standalone packages

        Applications are compiled and run from the command line

    • J2ME Wireless Toolkit

        Applications are compiled and run within a minimal development environment

Java Editions

Let's begin with a quick summary of the Java platforms currently available:

    • Standard Edition (J2SE): Designed to run on desktop and workstations computers.

    • Enterprise Edition (J2EE): With built-in support for Servlets, JSP, and XML, this edition is

      aimed at server-based applications.

    • Micro Edition (J2ME): Designed for devices with limited memory, display and processing

      power.

Configurations

To support the broad range of products that fit within the scope of J2ME, Sun introduced the

Configuration.

A Configuration defines a Java platform for a broad range of devices. A Configuration is closely tied to a Java Virtual Machine (JVM). In fact, a Configuration defines the Java language features and the core Java libraries of the JVM for that particular Configuration.

Following are typical characteristics of devices within the two currently defined Configurations:

Connected Device Configuration (CDC)

Connected, Limited Device Configuration (CLDC)

JVM and KVM

The engine behind any Java application (or applet, servlet, etc.) is the JVM.

Once you've compiled your Java source code into a class file(s), and optionally included them in a Java Archive (JAR) file, the JVM translates the class files (more accurately, the byte code in the class files) into machine code for the platform running the JVM.

The JVM is also responsible for providing security, allocating and freeing memory and managing threads of execution. It's what makes your Java programs go, so to speak.

KVM

For CLDC, Sun has developed what is referred to as a reference implementation of a virtual machine, known as the K Virtual Machine, or simply KVM.

The KVM is Sun's implementation of a JVM that fits the guidelines of the CLDC. It is not necessarily the only JVM that is or will be available.

Architecture

Generic Architecture

It begins with the host Operating System (OS) as the base, followed by the virtual machine (VM). The VM will take one of two forms:

CLDC or CDC core libraries are next in the heirarchy. Profiles are the topmost layer, and are designed to provide a toolkit for writing applications for a particular device family.

MIDP Architecture

As before, the host OS is the base. The virtual machine will be the KVM. Remember, the KVM is Sun's implementation of a JVM meeting the CLDC specification—it may not be the only implementation available of a virtual machine for MIDP. CLDC core libraries are next, followed by MID Profile.

Will J2SE applications run on J2ME?

J2ME is basically a slimmed down version of J2SE. Many components have been removed to keep the platform small and efficient. An obvious example is that of the Abstract Window Toolkit—many mobile devices do not have the screen capabilities to provide advanced user interface components such as overlapping windows and drop-down menus.

On the other hand, if you write J2SE code that adheres only to the classes that are available within the J2ME Configuration you are targeting, then your programs will run on both platforms. Keep in mind, such applications will most likely be very constrained, with little to no user interface, as J2ME and  J2SE offer completely different APIs for handling the display.

Will J2ME applications run on J2SE?

The same rules apply here. If you limit the code to what is common on both platforms, the answer is yes. However, the majority of software you write for a J2ME device will require special interface and event handling code. Thus, you are greatly limited to what types of programs will be appropriate for both platforms.

Putting all the Pieces Together

Sun created the Java 2 Micro Edition to allow development of Java applications for devices that do not have the same processing power and memory found on a typical desktop platform. Products may include cellular phones, PDAs, pagers, entertainment and automotive navigation systems, to name just a few.

J2ME is divided into two broad categories, known as Configurations.