Introduction to J2ME development

03/04/06 Permalink

Most mobile phones on the market today feature Java support in a varying degree of depth. If you are used to programming in Java but you want to know a bit more about J2ME, this article is for you.

Older phones (MIDP1) feature Java support but there are less code libraries available to use. In general they allow for basic GUI development, some basic graphics support, maybe some audio support (it's mostly only Nokia with their nokia.sound API) and some networking capabilities through sockets. Hardly any MIDP phones allow phone file access and are very restricted in the amount of persistent data you can store in the RMS (Record Managemnet System - basically a mini database which is available only to the application). One exception is the Nokia Communicator which offers some good Java support.

As phones become more powerful, the good news is that newer phones (MIDP2) are beginning to offer more libraries to work with. For example file access and good sound functionality are starting to become standard as are better GUI and graphics support and with better hardware comes more disk space to work in. Accessing hardware such as the camera and usb, bluetooth, infrared is starting to become possible in phones and this opens up possibilities for developers. This is not to say all MIDP2 phones are allowing these features, just that it's more likely.

A while back when I was looking to develop a video player application for phones I was disappointed to find that it was only really possible on a select few phones. This is because to play a video would likely require some kind of storage area (unless you wanted to take the expensive route and stream the video of net), and this wasn't possible without access to the main phone memory. At the time, how many phones had this support? A handful at most. And I wasn't going to spend ages developing the application and it only be available for a few phones. So I decided to find out exactly what kind of libraries phones supported, so that I could allow and application to run on the most phones. This is when I produced the Calibrator which works out what the phone's java environment is like. Using the results from this JAR you can work out if your JAR is going to be compatible or not with a certain phone. But you'd also need to test on as many phones as you can because the same application will run smoothly on one phone and not on another. Calibrator will just give you the sofware basics, hardware's a different matter.

Toolkits/IDEs/Emulators are another area you'll need to look into. Phone manufacturers will offer toolkits which are tailored for their phones and offer emulators which emulate a phone in a GUI application. I've tried most of them, but I tend to stick to Sun's WTK because it's a better all rounder. It's a good idea to download them all though just for testing purposes.

Useful:

Share It: Digg | del.icio.us | Furl | reddit | Facebook | Yahoo! | Send to Phone

mobile-utopia.com | Feedback