"A human being should be able to change a diaper, plan an invasion, butcher a hog, conn a ship, design a building, write a sonnet, balance accounts, build a wall, set a bone, comfort the dying, take orders, give orders, cooperate, act alone, solve equations, analyze a new problem, pitch manure, program a computer, cook a tasty meal, fight efficiently, die gallantly. Specialization is for insects." (Robert A. Heinlein)

Friday, 19 February 2010

Mobile development with the EEEPC: J2ME

If you wonder why I've been recently dusting off Netbeans on the EEEPC it's mainly because I decided to start experimenting a little with mobile programming on the Nokia 5800 XM. I've had experimented before with mobile programming but this is my first tentative with an “all Linux” solution.


To enable Netbeans to J2ME mobile development I had, at first, to download and install the mobility plug-in. From the plug-in management window …


Installing a wireless development platform

After plug-in installation, before I could begin a new project I had to install a development and emulation platform. Unfortunately the sun newly released Java ME SDK 3.0 is not yet available for Linux so I had to download the previous version also known as Sun Java Wireless Toolkit 2.5.2 from its download page. Curiously in this page Sun, with an odd humor, “strongly recommend” you to install the newly released (but not available to Linux users) 3.0 version.
WTK 2.5.2 installation is just matter of executing the downloaded file
chmod +x sun_java_wireless_toolkit-2.5.2_01-linuxi486.bin.sh
sudo ./sun_java_wireless_toolkit-2.5.2_01-linuxi486.bin.sh
the SDK path and the destination path are the only parameters requested.
After the installation I added the development platform to Netbeans from the Java platforms window (Tools → Java Platforms) by selecting the newly installed platform folder.


The first project

To create the first project I simply selected Java ME → Mobile application from the new project window.
after setting project details and selecting Java ME development platform
Netbeans created a full working hello-world program. Here is how it looks like in phone simulator (unfortunately it slips out of EEEPC screen)
To deploy the project so it can be tested on a real phone I had only to right-click on the project icon and selecting the “Deploy” option. Here is how it look like on the Nokia 5800 XM


I can call this experiment quite positive. Apart from some problem in Linux support, I hope Sun will solve this soon, and some off-screen slipping, I managed to produce yet another hello-world program. Developing mobile a program from an almost-mobile platform like the EEEPC has been very interesting experience, perhaps not very comfortable but still interesting.

No comments :

Post a comment