Developing J2ME application on Linux

We are starting up prototyping on a new project I’ve mentioned in this article. Our aim is to provide a proof-of-concept implementation of a simple off-line application running on the PDA’s we have.

The PDA’s of today are quite well equipped, they come with ample processor power and enough RAM for running medium sized applications. We’re supplied with some rugged Symbol PDAs, running Windows CE 2003 (I might be wrong there, as I haven’t laid my hand on one for longer than 5 minutes)
Just to make things clear, I never done any J2ME development and I’m not very familiar with the concept of configurations or profiles either.
Going through the Net and checking the scene I’ve found that there are only few options for J2ME development other than vi. The most favored recommendation seemed to be the Netbeans Mobility Pack, but I said I’m not touching that with a six foot pig-teaser pole. For the first run I’ve opted for using EclipseME instead.
EclipseME 1.6.8 is a pretty simple solution, and can use Sun’s Java Wireless toolkit 2.5.1 seamlessly under Linux.
In a couple of minutes I was able to bang together a simple HelloWorld midlet, being pleased with myself. This was going better than I thought, so I went on with extending the application. I banged together a simple form display using SAX based xml parser and the lcdui controls. After I had my first form with a couple of controls displayed I went out to the Net to see which embedded language I could use to store and evaluate the logic parsed from the XML. I went to see the usual suspects, BSF, Groovy, Jython, JavaScript and my favorite BeanShell. There were traces on the forums that some people have already struggled with this out there, this didn’t make me feel more secure, but at least I knew I was not alone. After hours of reading it turned out that BSH has the smallest footprint of this all (cca. 145Kb) but whatever I do the language will use reflection to access the host objects. This was hardly a surprise, but the surprise came when I realized MIDP and CLDC do NOT support reflection. This was the time when I realized that I was using the wrong environment all along.
No problem! – I thought – I just switch over to CDC and Foundation or Personal Basis Profile and I’m all set!
This was when my hair started graying, I went through the Internet to find a single CDC implementation that can run on Linux, but no luck. Sun, Nokia, Motorola, Sony just to name a few, even though all strongly support Linux don’t provide any development environment for any OS other than Windows. This basically means that once you want to develop for any PDA in J2ME you are resorted to use a Windows based machine.
There seems to be a touch of light on the end of the tunnel though, IBM does provide a solution even if it’s quite dated, that is Linux compatible. See the Websphere Studio Device Developer site to get a trial version. I thought Eclipse 2.0 is something I’ll never see in my life, but this is something I give a hearty welcome to! For our current project this is a reasonable alternative to use, but buying this for any other project seems unreasonable. As far as I can see this product is already discontinued, so I don’t expect to have it around for much longer.

4 Replies to “Developing J2ME application on Linux”

  1. If you used EclipseMe, what do you consider is so wrong with NetBeans Mobility Pack?

    For XML parsing I use kXML that’s designed for CLDC/MIDP and that doesn’t require anything extra. It’s also pretty light-weight.

  2. I’ve actually tried NetBeans with Mobility Pack for this job. The only thing about is that I just hate NB to start with. All my projects are in some kind of Eclipse based environment, and it’s a pain of getting used to NB. Anyway it does not have CDC support under Linux either, so there is no point of using it.

    For XML parsing I prefer SAX like parsers, so I choose TAM parser over kXML.

  3. I use only NetBeans, so that was why I wondered. kXML is very small, if code size is an issue, which it is in my case. I only make MIDlets as of now, as I focus entirely on mainstream phones. Smartphones run MIDlets too, but in that case UI suffers.

Leave a Reply

Your email address will not be published. Required fields are marked *