I programmed many different devices over the past 10 years. I particularily remember doing some J2ME work on a Palm IIIe and a Nokia 3510 (or something like that) about six years ago. I recently swapped my old cell phone, a Sony Ericsson T610, for a brand new Sony Ericsson W810i. Since I needed two small applications that I could carry around, I decided to give Java ME another shot. It was also a good excuse to try out NetBeans Mobility Pack that looks so great on the screenshots. Well, I am not disappointed. The Mobility Pack is damn good!
Even if I have not used all the goodness, my apps have only one form so the flow designer was pretty useless to me, I was really impressed by the ease of use provided by the tool. In just a few minutes you can have a full blown application running on your phone. Things get even better when you install the Sony Ericsson J2ME SDK on top of the Mobility Pack. You get extensive documentation, emulators for a large array of phones and some great features like debugging on device. I can just hook my phone onto the computer and deploy and debug my MIDlets from NetBeans. Installing the SDK also made me discover the incredible technologies we can now use on cell phones with Java ME: bluetooth, web services (that's right, SOAP support), XML, 3D graphics, camera, etc. Needless to say this is much much more than what I was used to work with when I first tried out J2ME.
Anyway, the two apps I wrote are very simple. The first one, Shutter Speed, computes the exposure time for a digital SLR given a few parameters (ISO, aperture, etc.) The second one, Get Rich, converts currencies. It uses a SOAP-based web service to get the exchange rate and perform its job. Since I needed this application for my trip to China (more on that soon), I also needed the application to remember the exchange rates without having to connect to the Internet every time I need to convert an amount of money. I'm still thrilled by the fact we can use SOAP directly (I once wrote a J2ME application for my French personal web site but I had to write a REST service in PHP on my server to interface on top of my existing web services.) Here are screenshots:
Many of you already know that, but Java ME has come a long way, both regarding available APIs and tools support. Adding the Sony Ericsson SDK tools and emulators to NetBeans only required to go through a two steps wizard. Deploying or debugging the application is not much harder and the visual design tools are just great.
I only encountered small issues when generating the stubs from the WSDL descriptor. The generated source code was using an exception class that does not exist in Java ME (at least in CLDC 1.1 and MIDP 2.0) but that was easy to get rid of. The W810i emulator was the other problem. First, the UI does not match the real UI at all: the screen size is different, the widgets are not quite the same, etc. Worse, the emulator does not really work like the phone. It is impossible, for instance, to make the web services calls from the emulator. It just craps out some nonsense instead of generating a well-formed SOAP document. That said, and given the large number of phones emulated by the SDK, I am not very surprised. Besides, with the ease of deployment and debugging, it does not matter that much (but if you have to perform OTA deployment to test your app on the phone after each change… argh :)
So if you have a Java ME enabled cell phone, just go grab the NetBeans Mobility Pack. It's free and it will let you write some cool and useful apps very quickly.
By the way, my applications can be downloaded from the following WAP page: http://progx.org/j2me. You can also download
ShutterSpeed.jar directly from this directory to install them with a bluetooth, infrared or USB connection. Get Rich requires CLDC 1.1, MIDP 2.0 and WAS 1.0 (JSR 172).