A Wireless Retirement

Dr. Dobb's Journal December 2003

By Jeff B. Cromwell

Jeff is an instructor in the math department at Indiana University of Pennsylvania. He can be reached at jcromwell@lcix.net.


Programming Wireless Devices with the Java 2 Platform, Micro Edition
Roger Riggs, Antero Taivalsaari,
and Mark VandenBrink

Addison-Wesley, 2001
345 pp., $44.99
ISBN 0201746271

Wireless Java: Developing with Java 2, Micro Edition, Second Edition
Jonathan Knudsen

Apress, 2003
384 pp., $34.95
ISBN 1590590775

Java 2, Micro Edition: Professional Developer's Guide
Eric Giguere

John Wiley & Sons, 2000
368 pp., $49.99
ISBN 0471390658

Teach Yourself Wireless Java with J2ME In 21 Days
Michael Morrison

SAMS, 2001
576 pp., $39.99
ISBN 0672321424

As part of a recent project, I had to develop a wireless-application architecture for an insurance product that was already in production. The product was an Internet-based, 401k-related application that delivered fund balances, investment elections, and monthly reports on asset allocations to agents, plan sponsors, and customers. The application needed to enhance the sales force's ability to assist in the communication of fund balances with corporate employees, plan sponsors, and customers—but in a mobile environment. Not only did the application need to replicate the transaction processing already available to participants, but further empower the sales force through the use of cell phones and hand-held devices (like Palm Pilots) to access information anywhere and anytime. The company's hope was that by reaching a younger, more technologically driven audience that it would be able to increase its customer base and upsell other retirement products. To incorporate additional functionality into this existing application, I turned to the books examined here (among others) as the first step in developing a plan of action and overall architecture that met the needs of developers, project managers, business analysts, and corporate sponsor.

In Wireless Java with J2ME In 21 Days, Michael Morrison did a good job of providing examples of MIDlets—that is, those applications that run on "Mobile Information Devices" and written to the J2ME's Mobile Information Device Profile (MIDP). One MIDlet I found particularly handy was the transaction class in the electronic check register. Since my application was financial, I was also looking for MIDlets that used logons, form validation, and navigation. Furthermore, I needed to find out J2ME's limitations in terms of client-side scripting. Morrison did a good job of addressing this topic. The contact manager application he included was useful, and the example of stripping sites for information as in the example of the wireless meteorologist was interesting. I even enjoyed the section of the J2ME wireless tour and his speculations on the future of J2ME. Both of these topics served me well in my discussion with upper management, for whom I ended up writing a whitepaper on the topic.

Wireless Java With J2ME In 21 Days uses the Motorola SDK, includes the APIs for MIDlets, and has a discussion of the CLDC and MIDP specifications. Almost all of my questions on the different types of phones and hand-held devices were answered. Overall, I was pleased with the code in the book and was able to copy some of the routines right into my application with little modification. The book comes with a CD-ROM that contains Sun's Java SDK, making it easy to insert example code into my application. I highly recommend Wireless Java With J2ME In 21 Days if you need a quick source of code and expertise to leverage for legacy applications.

Wireless Java: Developing with Java 2, Micro Edition, by Jonathan Knudsen, also focused on creating MIDlets. However, while he did present some real-world examples, Knudsen's focus was on building games. Still, his coverage of persistent storage was quite good and his discussion of parsing XML while implementing network security was instructive. Specifically, the section on building XML parsers in MIDP using J2MEWTK (Sun's Java 2, Micro Edition Wireless Toolkit) was helpful. For instance, I was able to insert PasswordMIDlet, a protected password client (page 159), directly into my application.

I particularly liked the sections on using XML, data synchronization, and network programming in Programming Wireless Devices with the Java 2 Platform, Micro Edition, by Roger Riggs, Antero Taivalsaari, and Mark VandenBrink. The book had plenty of information on how to design GUI components, handle GUI events, parse XML data, and transfer data over HTTP connections in wireless applications using J2ME MIDP. This is exactly what I was doing and the book's resource links helped. I also appreciated the information on packaging and deploying Java wireless applications. Granted, the sample applications were a bit simplistic, but the CLDC and MIDP API in the appendices were useful. Still, I didn't use any code from this book.

Finally, I read Java 2 Micro Edition: Professional Developer's Guide, by Eric Giguere, which was written for developers with a moderate level of Java knowledge. The book is code sparse, but nonetheless clear and concise—but darn it, it could have used more code. It includes a CD-ROM with the usual stuff—Java 2 Micro Edition specifications and references, JBuilder Foundation 3.5, and some samples. I went through the Tic-Tac-Toe source code in the appendix, but ended up not using any of the code for my application.

Each of these books provided some of the necessary information for solutions to my problems with wireless product migration. Thanks in part to them, the plan proved straightforward to implement, predictable, and provided a nice bonus—I can check on my 401k retirement plan whenever I want.

DDJ