This blog is subject the DISCLAIMER below.

Saturday, February 24, 2007

Explore the Java Platform-part3 APIs (J2ME - OverView)

Explore the Java Platform
Part 3
APIs

Well, it has been a long time since our last post in this series. I’m sorry for the delay, but I was really busy and I didn’t have any time to do any thing, any way lets get to the subject directly.

This part starts showing the APIs of the java platform, as discussed before, the java APIs are grouped into 3 main groups which are; Java Micro Edition (J2ME), Java Standard Edition (J2SE), and Java Enterprise Edition (J2EE), the 2 in the acronyms stands for a standardization level, as mentioned before, java has passed through many standardization levels and Java2 is considered an important milestone in the standardization of java because it added an extra huge functionality to the previous versions. Now the new acronyms will omit the 2 using the names as Java ME, Java SE and Java EE, however, we will use the old names in the article because we will just talk about common concepts, but it is always good to know the new acronyms.

3.1 J2ME
Java 2 Micro Edition (J2ME) is Sun's version of Java aimed at machines with limited hardware resources such as PDAs, cell phones, and other consumer electronic and embedded devices. J2ME is aimed at machines with as little as 128KB of RAM and with processors a lot less powerful than those used on typical desktop and server machines. J2ME actually consists of a set of profiles. Each profile is defined for a particular type of device -- cell phones, PDAs, microwave ovens, etc. -- and consists of a minimum set of class libraries required for the particular type of device and a specification of a Java virtual machine required to support the device. The virtual machine specified in any profile is not necessarily the same as the virtual machine used in Java 2 Standard Edition (J2SE) and Java 2 Enterprise Edition (J2EE).

To date, Sun has released the following profiles:
The Foundation Profile -- A profile for next generation consumer electronic devices
The Mobile Information Device Profile (MIDP) -- A profile for mobile information devices, such as cellular phones and two-way pagers, and PDAs

A profile in itself does not do anything; it just defines the specification. Profiles are implemented with a configuration. You can think of a configuration as an implementation of a J2ME profile for a particular type of device such as a PDA. Some of the configurations currently available are

Connected Device Configuration (CDC)
An implementation of the Foundation Profile for next-generation, consumer electronic and embedded devices

Connected Limited Device Configuration (CLDC)
An implementation of MIDP for small, resource-constrained devices such as Palm OS devices.


Since each profile defines a different set of Java class libraries, you cannot take a Java application written for one profile and run it on a machine that supports another profile. Likewise, you cannot take an application written for Java 2 Standard Edition (J2SE) or Java 2 Enterprise Edition (J2EE) and run it on a machine that supports J2ME. You can only use the Java classes provide in the Java class library included in your target device's profile.