Depending on whom you ask, Java 2 Micro Edition (J2ME) is either the best thing to happen since the cell phone or just another stillborn technology. If you subscribe to the latter viewpoint, you might as well stop reading here. If, on the other hand, you’re looking to get started developing J2ME applications on mobile devices, you should start reading Core J2ME Technology & MIDP, an outstanding introductory and reference book from Sun Press and Prentice Hall.

Core J2ME Technology & MIDP

By John W. Muchow
Sun Press/Prentice Hall PTR
December 2001
737 pages
ISBN: 0-130669113
Cover price: $49.99

Highs: Great reference value; won’t bore Java pros, but won’t confuse newcomers; lots of sample code.
Lows: Concentrates almost exclusively on mobile phones, with only a single chapter on Palm devices.

The book is divided into three sections. Part one, “Introduction to J2ME, CLDC and MIDP,” covers the basics, getting you up to speed on Sun’s mobile Java development platform. You’ll learn about the basic architecture of J2ME and the differences between micro- and standard-edition Java. You’ll also review the rationale behind some design decisions Sun made when adapting Java to mobile devices, which makes for surprisingly interesting reading. The distinction between a Configuration and a Profile is made crystal clear, and the book devotes a chapter to each of these somewhat nebulous concepts. The first section winds down with a quick tutorial on how to download, install, and use the software you’ll need to build J2ME applications, and finally wraps up by walking you through the process of building, packaging, and testing a very simple app.

The bulk of the book, and the part you’ll find most useful as a reference, is part two, “Programming with MIDP.” This section’s 10 chapters introduce the MIDP API and provide plenty of example code. Most of the space here is devoted to user interface classes and elements, but there’s also ample coverage of the classes that make up the guts of an MIDP app, like the RMS persistent storage and GCF communication API’s. Core J2ME walks you through the development of a sample application—in this case a to-do list. Although it’s an odd choice—I’d imagine that most MIDP-capable devices already have standard organizer functionality like this—it serves its purpose as a reasonable, practical example.

The final part of the book consists of three appendices. The first appendix examines the over-the-air provisioning system, the framework J2ME uses to install new software; author John W. Muchow shares his thoughts on best practices for using this toolkit. The final two appendices reprint the online MIDP and CLDC documentation for handy offline reference.

Getting to the core of my impressions
It’s hard to find much fault in Core J2ME, aside from its somewhat limited scope. The author concentrates almost entirely on cell-phone applications, devoting only a single chapter to Palm devices. Also, as the title would suggest, this book is dedicated to development with the MIDP profile and the CLDC configuration. If you’re looking for information on other configurations and profiles, you’d be best served to look elsewhere. Beyond these limitations and the sad lack of a code CD, which is something I rather expect nowadays, I can’t really find much wrong with this title. And you can download the source from the book’s Web site.

The chapters are well organized, containing just the right number of tables and plenty of readable, commented source code. Muchow discusses each code example in a clear, understandable manner, and concentrates on the practical aspects of his code whenever possible. I found the tables of constants and methods to be particularly useful, especially when pecking away at my code in Notepad. It’s somehow much easier to crack open this book than to search through the online docs when I need to find a particular constant name or can’t recall some method overload.

In fact, Muchow manages to strike a nice balance between being introductory enough to remain accessible to Java neophytes and maintaining the interest of experienced Java folks. I’d hazard a guess, in fact, that Core J2ME would also be useful as a first Java book for a programmer with experience in another language. Yes, it’s that good.