J2ME Overview

In this chapter, we will take a look at J2ME's place in the Java landscape, and you will get a bird's eye view of the different editions. Then you 'll look at the various components that make up J2ME before finally reviewing the tools, configuration, profiles, and virtual machines that make everything tick.

I shall Call It Mini-ME

Portable device are an exciting industry. Every time you turn around, there's another sexier model, with a bigger screen, more memory, higher bandwidth, and a faster CPU, usually with in an ever smaller form -and they come in a cool range of colors too.

Writing the software isn't the only problem. Delivering it to the device requires a platform capable of installing new software on demand, along with the channels to receive new code. And once installed, users must consider the security of the software and device.

So where do you turn for a solution to all these issues? Amidts a blaze of light, a big guy in your a yellow spandex suit leaps up, hands on hips, chest emblazoned with a big J and a small ME. Never fear, J2ME is here to make you look good in tights, I mean, to bring software to the micro masses! Had you worried, didn't it?

J2ME Architecture

From the enterprise development tools designed for use in servers to the micro system for which you 'r developing, each version has its own place in the Java landscape. It 's very important to not that the division between platforms is not simply categorical. The line between different platforms can get blurry. In fact, J2ME development sometimes requires the use of all three platforms (J2ME, J2SE, and J2EE). For example, when you 're developing a multilayer game, you use J2ME for the client-side device software, but you also benefit from the power of J2SE, and J2EE when you implement the backed server system.

We can see that the different java editions, along with the hardware each supports. As you can see, the various editions of Java suit distinctly different device classes. The hotspot VM is the default virtual machine supplied by Sun for executing the fullscale version of Java -Hotspot is a newer type of virtual machine capable of dynamically optimizing heavily executed code (hotspots) during runtime. The compact Virtual Machine (CVM) and Kilobyte Virtual Machine (KVM) are smaller virtual machine implementations designed to run within the constraints of the limited resources available on micro devices. We 'll look at which virtual machine is used for different devices a little later in the chapter.

In developing J2ME, it was obvious that trying to fit something like J2SE on a mobile phone would be like trying to stuff the Hindenburg down your pants. Since J2SE was obviosly way too big to fit on even the larger micro devices, Sun had to shrink it down. But which parts should they remove? With such a large variety of different devices, Sun didn't want to limit all J2ME appllications to the lowest compatible hardware set. This would unfairly compromise the functionality of the higher en devices.

The designer of J2ME came up with solution based on a revised Java architecture that provides for the exclusion of parts the platform (such as language, tools, JVM and API) while adding device category specific components. This is realized through a combination of J2ME configurations and profiles.

Configuration and Profiles

A configuration define the capabilities of a Java platform designed for use on a series of similiar hardware. Essentially, it provides for the minimization of the J2SE platform by removing components such as :
  • Java language component
  • Minimum hardware requirements, such as the memory, screen size, and processor power for the family of devices
  • Included Java libraries
Using this architecture, Sun created two initial configurations to suit the micro world -one for slightly limited devices such as PDAs and Set Top Boxes (like digital Tv receivers) and one for the "you wanna run Java on what?!" class of devices such as pagers, mobile phones, and pets. These two configurations are :
  • CDC (Connected Device Configuration)
  • CLDC (Connected Limited Device Configuration)
You will review both of these in more detail a little later. The important thing right now is that these configurations let you move forward, confident of the functionality of the underlying target platform. You will be developing for two platform at most, not two hundred.

However, configurations don't cover everything they merely limit Java to a suitable target platform's capablities - which is essentially a nice way of saying they rip out Java's guts. Additional functionality is required to handle the new breed of Java devices.
 
Themes by Ex Templates Blogger Templates l PC Tablet News l Blogger Pemula