J2ME: Thoughts after first look
For reasons I don’t feel like getting into, I’ve begun a journey to learn as much as possible about developing applications for micro devices. Before I even get started, let me say I have no prior experience with micro device programming, so a lot of what I say (in coming posts), could very well be wrong.
The cell phone I’m going to use as a test-bed is my own, a RAZR V3. Though I’m using a specific phone, a lot of what I say about micro devices will apply (I think) in the general case. The first thing needed, is to figure out the Java System settings on your device. In my case:
CLDC v1.0
MIDP v2.0
Data Space: 1545 K
Heap Size: 800 K
MIDP or Mobile Information Device Profile is a spec written for the development of Java applications on mobile devices, etc. In the grand design, MIDP sits on top of CLDC or Connected Limited Device Configuration, which is another spec outlining a framework for developing Java ME applications on resource constricted devices. Both CDLC and MIDP have been developed by the open source community, and as you can probably tell from my phone, different devices support different versions. The diagram below is from the J2ME Developers Guide for the Motorola V3 Handset. With that in mind, be sure to get your hands on the Developers Guide for your device.
In my case, the heap size is 800 K, this defines the amount of memory the JVM (Java Virtual Machine) can use to create objects, story temporary variables, etc. Developing on cell phone, PDA etc. is a different monster, you need to be conscious of memory size (both disk space and heap size), processing power, screen capabilities and wireless network characteristics.
After I skimmed through the Developers Guide, read up on J2ME, and browsed a couple Wikipedia pages, I set out to find the software I needed to get started. The first thing I did was install the SDK supplied by Motorola for my phone. I’m not even sure why they call it an SDK, the entire kit came with 2 applications. The first was MIDway, which is basically a tool to upload applications to your cell phone. The second was Motorola Launchpad, which acted as an emulator, to test applications on your computer. Undoubtedly, these programs will prove useful (eventually), but for now it’s not that helpful in developing applications. The obvious next install was J2ME, which can be found from the Sun website.
I ended up downloading a couple example applications (with source) from the Motorola website, and after getting a feel for them, wanted to upload these to my phone. After about 10 minutes of frustration, I realized USB application uploads to a cell phone are restricted to ‘Developer phones’. You can check if your phone allows USB uploads by looking in the Java Settings, and seeing if a ‘Java Link’ option available. After a little bit of research, I came across the Motorola Hackers Bible. A moderator from Mobile-Review.com I guess got fed up with people asking the same questions, and wrote a masterpiece. The guide covers a lot of thing, one of which includes transferring applications to your cell phone via USB cable. Needless to say, I spent the rest of the day reading through this guide…

