The Mobile Information Device Profile for Java 2 Micro Edition: Professional Developer’s Guide

The Ultimate Guide to Creating Applications for Wireless Devices

This is the first J2ME book devoted exclusively to MIDP development. This MIDP 1.0 book teaches you how to program your cellphone, interactive pager, or PDA. With valuable information that is still applicable under MIDP 2.0 and MIDP 3.0, whether you want to write a game or a serious business application, this book explains everything you need to know about writing Java applications using the Java 2 Micro Edition Mobile Information Device Profile 1.0. ISBN 0471034657, 380 pages Published November, 2001 by John Wiley & Sons, Inc.

MIDP for J2ME book C. Enrique Ortiz and Eric Giguère. ISBN 0471034657, 380 pages. Published November, 2001 by John Wiley& Sons, Inc. Available from all major bookstores, including

Interested in programming your cellular telephone, interactive pager, or PDA? Whether you want to write a game or a serious business application, this book explains everything you need to know about writing Java applications using the Java 2 Micro Edition Mobile Information Device Profile. Below are a couple of quotes from our readers:

“Excellent book for everyone who is interested in developing mobile applications with Java. The introduction is also useful for the less technical folks working in marketing and project management.”

“It’s the best book I read about MIDP. It covers all the areas I need to learn for J2ME programming, i.e. security, XML parser, etc. There are plenty code samples you can use as the base of your application.

The Mobile Information Device Profile, or MIDP for short, is the first Java 2 Micro Edition (J2ME) profile to be defined through the Java Community Process. Defined by an expert group consisting of major industry players like Motorola, Nokia, Research in Motion, Palm, and others, the MIDP defines a Java runtime environment for devices that are very constrained in terms of resources and capabilities (memory, CPU speed, input devices, power usage). It does this by extending the basic Java runtime environment defined by the Connected Limited Device Configuration (CLDC) to include classes for networking, user interface creation, and local data persistence.

You can purchase and use MIDP-enabled devices today, including phones from Motorola, Siemens and Nokia. You can also run MIDP applications on most Palm OS-based devices.

To learn more about J2ME in general, read Chapter 1, “Java 2 Micro Edition Basics” (Adobe PDF format).

Table of Contents


1. Java 2 Micro Edition Basics read online (Adobe PDF format)
2. The Mobile Information Device Profile
3. The MIDlet Lifecycle
4. User Interface Basics
5. User Interface Examples
6. Network Communication

7. The Record Management System
8. Security
9. Using XML in an Application
10. Techniques for Writing Better MIDP Applications
11. Final Thoughts

Appendix A: MIDP/CLDC Quick Reference
Appendix B: Resources


Detailed Chapter Descriptions

The book is organized into 11 chapters and two appendices and serves as a complete guide to MIDP programming.

Chapter 1, “Java 2 Micro Edition Basics,” introduces you to J2ME. It discusses how J2ME evolved and presents the concepts of configurations and profiles. It finishes with an overview of the Connected Limited Device Configuration (CLDC), the configuration that determines the core capabilities of the Java runtime environment used in MIDP-enabled devices. Note: this chapter is available for you to read online
in Adobe PDF format.

Chapter 2, “The Mobile Information Device Profile,” introduces you to the Mobile Information Device Profile, version 1.0. It includes a discussion of over-the-air provisioning and what to expect from the next release of the MIDP specification already in development.

Chapter 3, “The MIDlet Lifecycle,” describes how to build and run MIDP applications, which we refer to as MIDlets for short. A MIDlet resembles a Java applet, but it has different behavior and different requirements. Included in this chapter are all the steps required to build and package MIDlets by hand or with a development tool as well as a discussion of how MIDlets behave and what kind of programming errors to avoid.

Chapter 4, “User Interface Basics,” describes the MIDP user interface model and how to use the new user interface (UI) classes that the MIDP defines, which are different from the Abstract Windowing Toolkit (AWT) or Swing classes that you already know. The MIDP defines high-level and low-level UI abstractions, both of which are covered here. Each user interface component is covered in detail.

Chapter 5, “User Interface Examples,” takes you step-by-step through MIDP programming examples that demonstrate how to combine the user interface classes described in Chapter 4 to build complete user interfaces.

Chapter 6, “Network Communication,” describes how MIDlets can communicate with external servers by using HTTP and other protocols. It starts with a detailed explanation of the CLDC’s Generic Connection Framework, first introduced in Chapter 1. It then proceeds to show you how you can use HTTP as a way to exchange data with servers on the Internet.

Chapter 7, “The Record Management System,” describes the MIDP’s persistence mechanism. The Record Management System (RMS) lets you store arbitrary data locally on the device without involving a server.

Chapter 8, “Security,” describes how MIDlets can securely exchange data and authenticate users. Security is always important but is especially so on wireless devices. MIDP security is still in its infancy and is quite limited, but it warrants a separate discussion.

Chapter 9, “Using XML In MIDP Applications,” demonstrates how XML can be used to communicate with servers to exchange data and invoke Web services. Although XML is not part of the MIDP specification, there are MIDP-compatible XML parsers available that you can include in your applications. Besides explaining what XML is and how XML documents are created and parsed, this chapter also demonstrates how to invoke Web services by using the XML-based Simple Object Access Protocol (SOAP).

Chapter 10, “Techniques for Writing Better MIDP Applications,”describes how to avoid potential pitfalls and how to make your MIDP applications more portable and more efficient.

Chapter 11, “Final Thoughts,” wraps up our discussion of MIDP programming and describes alternatives and future directions.

Appendix A, “MIDP/CLDC Quick Reference,” is a complete reference guide to all the classes defined by the MIDP 1.0 and CLDC 1.0 specifications.

Appendix B, “Resources,” lists J2ME and MIDP programming resources.

I’ve some copies left of this book. If you are interested, send me an email.

About the Authors

C. Enrique Ortiz

Co-author of Mobile Information Device Profile for Java 2 Micro Edition
C. Enrique Ortiz is a software architect and developer, and a mobile/wireless technologist and writer. He is author or co-author of many publications, a co-designer of Sun Microsystems’ the Mobile Java Developer Certification Exam, and an active participant in the wireless Java community and various J2ME expert groups. Enrique holds a B.S. in Computer Science from the University of Puerto Rico and has over 14 years of software engineering, product development, and management experience. You can reach Enrique by sending an email to eortiz[at]j2medeveloper[dot]com.

Eric Giguère

Co-author of Mobile Information Device Profile for Java 2 Micro Edition and Author of Java 2 Micro Edition

Eric is the author of Java 2 Micro Edition, the first book about J2ME, and co-author of Mobile Information Device Profile for Java 2 Micro Edition.  He also writes for the Sun Wireless Web Site and other online resources. Eric is a software developer/architect and Java guru at iAnywhere Solutions, a wholly-owned subsidiary of Sybase, currently working on the m-Business Studio product. At iAnywhere Solutions since 1993, Eric has worked on a number of products, including UltraLite, PowerJ, Power++ and Watcom VX-REXX. Prior to that, Eric worked for the Computer Systems Group, a research group at the University of Waterloo. Eric is the author or co-author of three books and has MMath and BMath degrees in Computer Science from the University of Waterloo.

For more information about Eric, see his web site or you can drop him a note.