In the previous article I mentioned the issue of fragmentation: Its a real problem for mobile developers. Sun has long peddled Java as "Write Once Run Anywhere", but has to a large extent been bullshit - due to platform fragmentation.
To address the fragmentation issue the Java Community has been moving towards the adoption of a number of
standards or "JSR"s. These mandate a certain 'minimum' set of functionality that you as a developer can expect to find on a particular device. For mobile phones, the most important standard is the "Mobile Information Device Profile" - better known as MIDP. Almost all Java-enabled mobile phones support MIDP.
There are currently two versions of MIDP: 1.0 and 2.0. At the time of writing, most of the phones on the market are MIDP 1.0 devices. However, MIDP 2.0 is beginning to appear on high-end devices - mostly smartphones such as the Nokia 6600. Its likely that MIDP 2.0 will start to become more the norm in 2005 (at least,
Russell Beattie thinks so and I believe him :) MIDP 2.0 is backwards-compatible with MIDP 1.0, so if you write a MIDP 1.0-compliant app then it should work on most of the phones available today. Emphasis on
should.
There are also standards for a number of optional packages.
A number of standards have been developed in order to address the fragmentation issue. For mobile phones, this means the Mobile Information Profile - MIDP for short.
Luckily there are a few standard available:
A
configuration specifies a certain Java Virtual Machine and a set of core APIs. There are two (refer to diagram) - the Connected Device Configuration (CDC) and the Connected Limited Device Configuration (CLDC).
Ground Zero: Resources to get you startedOk, enough theory already ! If you have no programming background at all, here are some resources to get you started.
Java 2 Standard EditionYou need to learn a bit of J2SE first to familiarise yourself with the general principles of the Java language - this is the most difficult and painful step. The books on J2ME assume you already know J2SE so there's really no avoiding it. Just think you'll be able to program your desk top as well !
If you're feeling stingy, there is a free
Java Tutorial on Sun's Java website. There's plenty of other documentation there if you're willing to dig through the site, but its a bit of a mess. You will also need to download the
J2SE Software Development Kit, which is free.
Otherwise you'd better buy a book. My personal favourite is
Head First Java. This has been written in an irreverent and (occasionally) amusing manner specifically to help you keep your attention and remember things - and it seems to work.
Sam's Teach Yourself Java in 21 Days is ok if you prefer the traditional textbook approach - but its a bit dull, know what I mean ? You'll have to grind through it.
Java 2 Micro EditionIf you survive J2SE you'll find this easy. J2ME is far less complicated than J2SE because the devices are so much more limited ! There is documentation on the
J2ME website but for this one you really are better off buying a book. There aren't many to choose from (I'm only aware of two recent ones, and I've only read one). I've got
Wireless Java: Developing With J2ME, Second Edition by Jonathan Knudsden. Its pretty good, in my opinion. It is written very clearly and concisely and will drag you straight into writing applications.
J2ME Wireless ToolkitThis contains emulators for different types of mobile phone, tools for packaging and compiling your code etc. Its simple, effective and free.
That should keep you busy for a few months

If you're serious, one other useful resource is the
Mobility Developer email newsletter Sun sends out every week or so (yes they do some good things). You need to
subscribe to receive it, and open an account on Sun's website (free). It contains tips on how to attack certain problems and small challenges for you to work on to develop your knowledge.