Java ME development experience
In my final term at University I am studying a module called Mobile and Ubiquitous Computing. Most of this module is concerned with technologies surrounding cellular networks and mobile phones (although it does extend into other mobile devices such as PDAs).
The first assessment set for this module was to build a Tip Calculator in Java ME using the CLDC 1.1 and MIDP 2.1 development stacks. We had the option to use the relatively new LWUIT if we wished to as well. When I first found out about this assessment I was rather excited. Playing with the iPhone SDK last summer has given me a desire to experiment with building applications for mobile devices.
Sun Wireless Toolkit
Eager to get started I downloaded the required development kits to get started. Now this is where the excitment ended and nightmare ensued. The first insult to injury was that Sun have decided to not provide their wireless toolkit (which includes the required emulator) for Mac. This posed a bit of a problem as the assignment specification specifically stated it has to run in this particular emulator.
My first thought was to install a virtualization software and run Windows XP just for the assignment. I downloaded a copy of Sun’s Virtual box and used the IE testing images for Virtual PC to get a copy of Win XP running. However further problem came in trying to install java and the wireless toolkit on windows XP in Virtual Box. I don’t know what i was doing wrong, it just would not work. After about 3 days of tampering and hacking about i gave up on that approach and decided to try and find an alternative emulator, and then i will just test the application on a University windows machine before submission.
Micro-emulator to the rescue
Eventually I found a alternative was to use the Micro-emulator along with a Netbeans 6+ plugin which ties them together creating a slick development environment. This was fantastic, it worked perfectly! The only gripe came later when trying to use the LWUIT I had to re-complie the java source to run it on the windows emulator. Regular MIDP and LCDUI did not have this problem.
LWUIT promised so much but eventually failed
The Lightweight UI Toolkit is a relatively recent development from Sun which provides a UI layer to create much more rich User-Interfaces for the user. It also gives the developer much more control than LCDUI over the look and feel of the application. Everything was going very well with LWUIT until I found a bug which effected both the Wireless toolkit emulator and Micro-emulator which only allowed you to run the MIDlet once. If you exit the MIDlet and then try to start it again it simply wont display. That was the end of the road with LWUIT and i had to learn to give up control of the look and feel of the end application.
LCDUI problems
Discovering that using LWUIT was not feasible due to strange bugs that I could not find a workaround for, I switched to using LCDUI. LCDUI is a very simple User-Interface library, but its simplicity comes at the cost of no control over the look and feel of the end application. One of the requirements of the Tip Calculator was to make it easy to use in dim-lit restaurants. On the face this essentially means lots of contrast and big fonts. This is simply something outside of your control in LCDUI. The only way you can achieve this is by building your own components using the build in canvas, which means taking care of absolutely every aspect of every input mechanism, from rendering to interaction.
The Tip Calculator
Despite all the limitations, frustrations and walls I had to climb, I had to produce a result. That result ended up being what is shown in the screenshots below. I ended up having to write abstractions for most things as they are very primitive and did not support my goals to make a flexible, fully functioning Tip Calculator. One example is that i had to write a class to represent Money and provide calculations for that as there is no BigDecimal available in Java ME. Unfortunately using float or double for financial calculations is not a good idea because of their lack of precision and are unnecessary for this application.


Java ME vs iPhone SDK
After using Java ME, it is no wonder that Java ME applications never really took off with developers or the mainstream users. While it is designed for less capable hardware than the iPhone SDK it is a bit too limiting and should have already been superseded with a new technology (Google + Sun working together on Android maybe? - probably not, “its not Java” - hehe). The iPhone SDK in comparison gives you all the tools you need to create very rich experiences on a mobile device.
Conclusion
I think its fair to say that is the only time I will experience Java ME development. If i ever do mobile development in the future i will stick with the much nicer iPhone SDK.
Comments
Commenting is not available in this section entry.