The authoritative tutorial for wireless J2ME application developers.
The Java 2 Micro Edition (J2ME) platform gives developers breakthrough tools for building advanced wireless applications. Now, one of the leading wireless application consultants at Sun has written a step-by-step guide to successful wireless development using the J2ME SDK. Vartan Piroumian illuminates every key feature of the J2ME platform and every step of the development process: planning, architecture, design, coding, compilation, execution, debugging, and deployment. Wireless J2ME Platform Programming covers all this, and more:
Wireless J2ME Platform Programming: The must-have guide for writing robust, highly usable, cross-platform wireless applications.Back cover box:
Featured topics include:
For your convenience, you can download the complete set of code examples from the book in a compressed archive. The code is available in two compression formats:
(NOTE: Each chapter concludes with a Summary.)
1. Introduction to the Java 2 Micro Edition (J2ME) Platform.
Defining a Java Platform for Pervasive Devices. Configurations and Profiles. The Connected Device Configuration (CDC). Connected, Limited Device Configuration (CLDC). Device Application Management Systems.
Designing and Coding. Compilation. Preverification. Packaging. Creating the JAR Manifest File. Creating the MIDlet Suite JAR File. Creating the MIDlet Suite Application Descriptor File. Deployment and Execution. Using the J2ME Wireless Toolkit. Creating a Project. Placing Source Code in the Project. Compiling the Project. Packaging the Project. Deploying the Application. Executing the Application.
The Application Execution Lifecycle. MIDlet Program Structure. The MIDlet State Model. The MIDP UI Component Model. System Properties. Application Properties.
Command Processing. Command-Processing Scenario. Screen Navigation. Command Organization. Command Ordering. Command Semantics.
MIDP UI Component Hierarchy. Screens and Screen Elements. Screen Navigation. More Item Components. DateField. StringItem. Gauge. Ticker. ImageItem. One More Screen Type.
Command and Event Handling. Key Events. Game Actions. Graphics Drawing. The Graphics Model. The Graphics Class. Basic Geometric Drawing. Clipping. Translation. How Components Are Painted. Double Buffering. Image Display Using a Canvas.
Device Support for Persistent Storage. RMS Data Storage Model. Records. An Example Application. Manipulating byte  Data. Enumerations. Record Filters. Record Comparators. Record Listeners. Miscellaneous Record Store Features.
The MIDP Networking Model. The MIDP Generic Connection Framework. Connectors and Connections. Generic Connection Framework Classes and Interfaces. Stream Connections. Content Connections. Datagram Connections and Datagrams. Socket Connections. Differences between J2ME and J2SE Networking.
Concepts. Locales and Localization. Character Encoding Sets. Aspects of Internationalization. Internationalization Support in MIDP. I18N Frameworks. Messaging. String Collation. Date, Time, and Numeric Formatting. Calendar and Time Zone Support. Designing an I18N Solution for a MIDP Application. Using MIDlet Attributes to Define L10N Resources. Using Application Text Files to Define L10N Resources. Using Java Class Files to Define I18N Resources. Application Provisioning of L10N Resources.
Concepts. The Provisioning Process. Application Registration. Application Search. Compatibility Verification. Purchase Verification and Non-Repudiation. User Authentication. Application Software License Negotiation. Application Download. Application Installation and Installation Verification. Billing Event Generation. Application Update. Application Removal. Prepari
This book teaches you how to develop software for the Sun Microsystems J2ME platform. It follows a tutorial-style approach; it's not a reference manual. The aim is to give you a solid foundation in concepts and techniques that will enable you to venture off and develop quality applications independently.
Consistent with this approach, this book doesn't provide endless pages of API documentation; I leave that offering to the Sun Microsystems Java Software Web site, which maintains the latest and most accurate API documentation. The reader might find it useful, therefore, to have access to the official Java Software J2ME API documentation while reading this book, which can be found at
http://java.sun.com/j2me/docs. You can either download the full API documentation or read it online. Additionally, Prentice-Hall publishes as part of its Java series a J2ME reference manual that compliments this book.
Also absent by design from this book are specific details of J2ME development tools offered by third-party vendors. In concert with the book's tutorial approach, I only introduce you to the Sun Microsystems J2ME Wireless Toolkit, which is the reference development toolkit for J2ME. It's available free of charge from Sun Microsystems at the Java Developer Connection Web site, which you must access by logging in. Follow the developer connection link from
http://java.sun.com/. In this way, you can become familiar with a J2ME development environment and emulator and build and test real applications.
Device manufacturers often provide development tools of their own that are similar to Sun's J2ME Wireless Toolkit. Additionally, other third party software companies offer J2ME development tools. This book doesn't discuss those tools because they don't add anything to the concepts or pragmatics of how to design and develop J2ME applications.
This book also defines and discusses wireless application provisioning systems and covers application deployment and provisioning from a conceptual perspective, without becoming mired in the details of specific vendor offerings of provisioning server software. The notion of application deployment is more visible-and more critical-with J2ME than with other platforms such as J2SE. In fact, understanding deployment issues is a crucial element of the J2ME application development process.
Finally, I expose the reader to ideas surrounding application architecture. As we rely more heavily on computing devices that are continually becoming more pervasive, it becomes increasingly important for developers to think about reliability, performance, scalability, security, manageability, and so forth. This book gives you an introduction to these concepts and to the notion that developers must think about these characteristics from the outset.
Although this book introduces elements comprising the breadth of the J2ME platform, it focuses on the CLDC and MIDP, which support personal, mobile, independent devices-those with intermittent network connectivity, such as mobile phones. Programming examples and API discussions address this subset of the J2ME platform. The reason for this choice is that, as a J2ME developer, you will most likely be called upon to develop applications for this class of devices.
The book is organized as follows:
Chapter 1 introduces you to the J2ME computing platform. It defines much of the J2ME terminology and gives you a general orientation to the concepts that surround the design and organization of the J2ME platform.
Chapter 2 describes the J2ME application development process. You learn how to create, compile, prepare, execute, and debug J2ME applications. This chapter doesn't cover the toolkit or APIs. Coverage of those items begins in Chapter 3.
Chapter 3 describes the J2ME MIDP platform from the software developer's point of view. Here you learn the organization of the APIs and the basic programming abstractions and models defined by the MIDP platform.
Chapter 4 continues where Chapter 3 left off. It covers the MIDP high-level API, which encompasses the bulk of the UI components defined by the MIDP. You learn how to manipulate the various UI components and also how to do event handling, called command processing in MIDP terminology.
Chapter 5 covers the MIDP user interface (UI) components. After learning the basic abstractions defined by the MIDP in Chapter 4, you're ready to learn how to use the components that are built upon those abstractions.
Chapter 6 covers the MIDP low-level API, which is implemented by the balance of the MIDP UI components not covered in Chapter 5.
Chapter 7 covers the persistent storage mechanisms available to you using the MIDP.
Chapter 8 is dedicated to networking and communications. Here you learn how to use the networking and distributed processing services and functionality defined by the CLDC and MIDP. You will also acquire some insight on the decisions for design and support of connectivity services in J2ME.
Chapter 9 gives you an introduction to internationalization. This is a topic of considerable breadth and depth that requires more than even a single, dedicated volume. Here, you'll learn about some of the issues that you'll encounter while building real-world MIDP applications. This chapter covers the extent of the internationalization support in the CLDC and MIDP and shows some examples of how to employ their features. You'll also learn how to configure your device environment to support internationalization and localization.
Chapter 10 covers application management and provisioning systems. Conceptual familiarity with these systems is important to the J2ME application developer, particularly MIDP developers, because these systems affect your interaction with application and content providers, wireless network carriers, and even end users.Chapter 11 discusses the wireless Internet environment. It discusses the integration between wireless and fixed networks, the wireless Internet from the application developer's perspective, and the context in which applications execute. You'll get an introduction to wireless Internet gateways, Internet portal interfaces, and wireless application interfaces and services-all things that you're likely to encounter as a wireless application developer. This chapter also introduces basic architectural concepts and how they influence the J2ME application developer.
This book is intended for Java developers. It's suitable for professional software developers and advanced students alike. More precisely, this book expects the reader to be fluent with the Java programming language but doesn't assume programming experience with particular APIs beyond the core Java APIs. Notwithstanding a lack of experience in any particular area of Java programming beyond fluency with the language, it's helpful if readers have at least an understanding of the concepts and vernacular that surrounds various Java technologies, such as those terms related to virtual machines, garbage collection, class loading, class verification, native code interfaces, just-in-time compilation, AWT, RMI, JDK, JRE, and so forth.
I also assume, however, that the reader has a decent background in object-oriented programming. For this reason, I don't explain object-oriented concepts when they arise during the process of discussing the J2ME APIs, classes, programming idioms, and so forth.
Of course, the more experience the reader has, the better. Throughout the book, various references are made to AWT and Swing. A significant part of MIDP programming involves manipulating user-interface components. The reader with knowledge of AWT or Swing toolkit abstractions can quickly glean useful insights into the organization and abstractions of the MIDP's UI programming model. Notwithstanding the benefits of AWT and Swing experience, you don't need to have any previous background in Java UI development.
You can download the J2ME Wireless Toolkit and full API documentation by following the links to the Java Developer Connection from
http://java.sun.com/. There, you'll find full API documentation for CDC, the Foundation Profile and the CLDC/MIDP, as well as the toolkit for all platforms such as Solaris, Linux, Windows NT, and Windows 2000.