Tuesday, 23 October 2007

Java Micro Edition on Windows Mobile

For one of our customers we were asked to make a mobile application on the hardware of their choice. In this case a hardened PDA with windows mobile on it. The devices are great, you can drive your car over them or drop them in the bath and they still work!
Anyway, examination of the devices revealed that they had no Java support. So did we decide to take the MS Visual Studio route? Of course not, we eat, drink and breath Java, so we're not going to let that happen are we....

A quick search of the net revealed some promising candidates for virtual machines that can be installed on windows mobile. Some time later we were narrowing it down to one (1) alternative: IBM's J9 Websphere Everyplace Micro Edition. That's all there is in this space at the moment. Nothing else. Zilch. All the others have disappeared, are limited time trials or been bought and are now kept under lock and key. Luckily you can download an unlimited trial version from the IBM website. Download it quickly because i have the feeling it won't be there for long. Register and search for "IBM J9 WEME". You should get a plethora of download options. More on that later.

Although i'm no microsoft expert there seem to be a definite advantage for software vendors to using java over the .net compact stuff:

  • The .net compact framework (or whatever it is that microsoft calls its application development stuff nowadays) seems to be slightly different on Windows CE, 2003, 2005 and 2006. We tried a demo application that was written for 2005 and it didn't work on 2003. So if your client decides they will be using windows mobile 2003 you have to change your software. Presumably this applies to windows mobile 2006 as well. Of course there are different java versions and compatibility problem in j2me apps, but you can fix that by upgrading to a new java VM which is nowhere near as drastic as upgrading the whole operating system.

We eventually got both the emulator and device runtime working for both MIDP 2.0 and Personal Profile and even got SWT running. Our application does network connections, uses the touchscreen, has a low level user interface and uses the Midlet lifecycle methods actively. All of these things were non-trivial in the IBM virtual machine.

I'm out of time right now. In the coming weeks i'll be writing on how to install it, how to run it (even harder) and what things don't work or work in a completely unexpected way.

1 comment:

Robin said...

Since writing this article, i found out that the company that makes the Intent JVM has gone bust, which makes its future very uncertain.