J2ME (Java 2 for mobile) has had me curious. I have a J2ME friendly phone. I’m doing Java in DSA2. It can’t be that hard to write something for the phone, can it?
Turns out it really isn’t too bad. The bugger of it is fiddling with the right mix of software development kits and Eclipse’s Java settings. The other fun part is figuring out which SDK matches with the Nokia 6600 phone (for those wondering, its Series 60, v2 FP1 (feature pack 1)). I lost a good amount of time just trying to figure that one out.
But the development process wasn’t too bad once Eclipse was setup to compile and package. I haven’t mastered the art of persuading the emulator to run from the “run program” button, but I found I can use Nokia’s Eclipse add-on buttons to run the emulator from there.
The last thing to try was to actually write something to run on the phone. What better test than the current programming assignment (due this coming Monday, but already turned in). I had to water down the code since the phone lacks a lot of the features the desktop edition of Java has. Once I put together the interface, the rest of the Java class files just dropped right in with a little bit of tweaking here and there. Here’s some screen shots of the Slicing Floor Plan from my 6600:
The config screen – specify the plan here:
The drawing of the binary tree:
The drawing of the floor plan:
Feel free to browse the code. I don’t know if it’ll work on other J2ME gadgets. If it does, great!
Just like the desktop edition.