Programming Wireless Devices with the Java 2 Platform, Micro Edition / Edition 2

Paperback (Print)
Used and New from Other Sellers
Used and New from Other Sellers
from $1.99
Usually ships in 1-2 business days
(Save 96%)
Other sellers (Paperback)
  • All (18) from $1.99   
  • New (6) from $40.25   
  • Used (12) from $1.99   


This book presents the Java™ 2 Platform, Micro Edition (J2ME™) standards that support the development of applications for consumer devices such as mobile phones, two-way pagers, and wireless personal organizers. To create these standards, Sun collaborated with such consumer device companies as Motorola, Nokia, NTT DoCoMo, Research In Motion, Samsung, Siemens, Sony Ericsson, and many others. The result is a highly portable, small-footprint application development environment that brings the unique capabilities of Java technology, including platform independence and enhanced security, to the rapidly growing wireless market.

This definitive Java™ Series guide provides a programmer's introduction to the Java 2 Platform, Micro Edition. It presents a general description of wireless technology and an overview of the J2ME platform. In addition, the book details the Connected Limited Device Configuration (CLDC) version 1.1 and the Mobile Information Device Profile (MIDP) version 2.0, the standards that define the Java platform features and libraries for wireless, resource-constrained devices.

Written by a team of authors that includes the original J2ME technology experts from Sun, Motorola, and Nokia, this book provides a description of the Java 2 Platform, Micro Edition, as well as practical implementation advice.

The Java™ Series is supported, endorsed, and authored by the creators of the Java technology at Sun Microsystems, Inc. It is the official place to go for complete, expert, and definitive information on Java technology. The books in this Series provide the inside information you need to build effective, robust, and portable applications and applets. The Series is an indispensable resource for anyone targeting the Java™ 2 platform.


Read More Show Less

Editorial Reviews

This book offers an overview of the Java 2 Platform, Micro Edition. It describes standards that support the development of applications for cell phones, two-way pagers, and wireless personal organizers, presenting a general description of the technology involved and information on the small-footprint K Virtual Machine. The book also outlines the goals, requirements, and scope of the CLDC and MIDP standardization efforts, high-level CLDC and MIDP platform architecture, CLDC and MIDP application models and compatibility with Java language, and CLDC and MIDP libraries. Annotation c. Book News, Inc., Portland, OR (
Read More Show Less

Product Details

  • ISBN-13: 9780321197986
  • Publisher: Addison-Wesley
  • Publication date: 6/4/2003
  • Series: Java Series
  • Edition description: Second
  • Edition number: 2
  • Pages: 434
  • Product dimensions: 7.30 (w) x 9.00 (h) x 1.10 (d)

Meet the Author

Roger Riggs is a senior staff engineer at Sun Microsystems who focuses on design and architecture of the Java 2 Micro Edition platform for wireless devices. He led Sun¿s efforts within the Java Community Process to standardize the MIDP 1.0 and 2.0 APIs.

Antero Taivalsaari is a senior staff engineer at Sun Microsystems. Dr. Taivalsaari co-founded the Spotless project at Sun Labs, and designed the original KVM system that became the cornerstone of the Java 2 Platform, Micro Edition. In addition, he led the CLDC 1.0 and 1.1 standardization efforts.

Jim Van Peursem is chief architect for the J2ME platform at Motorola. Dr. Van Peursem has been actively involved in the application of Java technologies in mobile wireless devices from the beginning. His contributions include serving as specification lead for JSR 118 (MIDP 2.0) and interpretation guru for JSR 037 (MIDP 1.0).

Jyri Huopaniemi is research manager at Nokia Research Center. Dr. Huopaniemi led the Mobile Media API (JSR 135) and Mobile 3D Graphics API (JSR 184) standardization efforts. He was also responsible for the Sound API of MIDP 2.0.

Mark Patel is the lead graphics architect for the J2ME platform at Motorola. His involvement with Java spans several years and includes the development of various APIs for graphics and user interfaces. He led the development of the Game API for MIDP 2.0.

Aleksi Uotila is a senior design engineer for the J2ME platform at Nokia. He has actively contributed to several J2ME-related expert groups within the Java Community Process, including MIDP 1.0 and 2.0.


Read More Show Less

Read an Excerpt

Chapter 2: Overview of Java 2 Platform, Micro Edition (J2ME™)

2.1 Java 2 Platform

Recognizing that one size does not fit all, Sun Microsystems has grouped Java technologies into three editions, each aimed at a specific area of today's vast computing industry:
  • Java 2 Platform, Enterprise Edition (J2EE™) for enterprises needing to serve their customers, suppliers and employees with scalable server solutions.
  • Java 2 Platform, Standard Edition (J2SE™) for the familiar and well-established desktop computer market.
  • Java 2 Platform, Micro Edition (J2ME™) for the combined needs of:
    • consumer and embedded device manufacturers who build a diversity of information devices,
    • service providers who wish to deliver content to their customers over those devices,
    • content creators who want to make compelling content for small, resource-constrained devices.
Each Java platform edition defines a set of technologies that can be used with a particular product:
  • Java virtual machines that fit inside a wide range of computing devices,
  • libraries and APIs specialized for each kind of computing device,
  • tools for deployment and device configuration.
Figure 2.1 illustrates the Java 2 Platform editions and their target markets, starting from the high-end platforms on the left and moving towards low-end platforms on the right. Basically, five target markets or broad device categories are identified. Servers and enterprise computers are supported by Java 2 Enterprise Edition, and desktop and personal computers by Java 2 Standard Edition. Java 2 Micro Edition is divided broadly into two categories that focus on high-end and low-end consumer devices. Java 2 Micro Edition is discussed in more detail later in this chapter. Finally, the Java Card™ standard focuses on the smart card market....

2.2 Java 2 Platform, Micro Edition (J2ME)

...Java 2 Platform, Micro Edition (henceforth referred to as Java 2 Micro Edition or J2ME) specifically addresses the large, rapidly growing consumer space, which covers a range of devices from tiny commodities, such as pagers, all the way up to the TV set-top box, an appliance almost as powerful as a desktop computer. Like the JAVA 2 PLATFORM, MICRO EDITION (J2ME) 9 larger Java editions, Java 2 Micro Edition aims to maintain the qualities that Java technology has become known for, including built-in consistency across products, portability of code, safe network delivery and upward scalability.

The high-level idea behind J2ME is to provide comprehensive application development platforms for creating dynamically extensible, networked devices and applications for the consumer and embedded market. J2ME enables device manufacturers, service providers and content creators to capitalize on new market opportunities by developing and deploying compelling new applications and services to their customers worldwide. Furthermore, J2ME allows device manufac-turers to open up their devices for widespread third-party application development and dynamically downloaded content, without losing the security or the control of the underlying manufacturer-specific platform.

At a high level, J2ME is targeted at two broad categories of products:

  • High-end consumer devices. In Figure 2.1, this category is represented by the grouping labeled CDC (Connected Device Configuration). Typical examples of devices in this category include TV set-top boxes, Internet TVs, Internet-enabled screenphones, high-end wireless communicators and automobile entertainment/ navigation systems. These devices have a large range of user interface capabilities, total memory budgets starting from about two to four megabytes and persistent, high-bandwidth network connections, often using TCP/IP.
  • Low-end consumer devices. In Figure 2.1, this category is represented by the grouping labeled CLDC (Connected, Limited Device Configuration). Cell phones, pagers, and personal organizers are examples of devices in this category. These devices have very simple user interfaces (compared to desktop computer systems), minimum memory budgets starting at about 128 kilobytes, and low bandwidth, intermittent network connections. In this category of products, network communication is often not based on the TCP/IP protocol suite. Most of these devices are usually battery-operated.
The line between these two categories is fuzzy and becoming more so every day. As a result of the ongoing technological convergence in the computer, telecommunication, consumer electronics, and entertainment industries, there will be less distinction between general-purpose computers, personal communication devices, consumer electronics devices, and entertainment devices. Also, future devices are more likely to use wireless connectivity instead of traditional fixed or wired networks. In practice, the line between the two categories is defined more by the memory budget, bandwidth considerations, battery power consumption and physical screen size of the device, rather than by its specific functionality or type of connectivity.

Because of strict manufacturing cost constraints, the majority of high-volume wireless devices today such as cell phones belong to the low-end consumer device category. Therefore, this book focuses only on the CLDC and MIDP standards that were specifically designed for that category of products.

2.3 Key Concepts of the J2ME Architecture

While connected consumer devices such as cell phones, pagers, personal organizers and TV set-top boxes have many things in common, they are also extremely diverse in form, function, and features. Information appliances tend to be special-purpose, limited-function devices. To address this diversity, an essential requirement for the J2ME architecture is not only small size but also modularity and customizability.

In general, serving the information appliance market calls for a large measure of flexibility in how computing technology and applications are deployed. This flexibility is required because of

  • the large range of existing device types and hardware configurations,
  • the different usage models employed by the devices (key operated, stylus operated, voice operated),
  • constantly improving device technology,
  • the diverse range of existing applications and features,
  • the need for applications and capabilities to change and grow, often in unforeseen ways, in order to accommodate the future needs of the consumer.
The J2ME architecture is intended to be modular and scalable so that it can support the kinds of flexible deployment demanded by the consumer and embedded markets. To enable this, the J2ME environment provides a range of Java virtual machine technologies, each optimized for the different processor types and memory footprints commonly found in the consumer and embedded marketplace.

For low-end, resource-limited consumer products, the J2ME environment supports minimal configurations of the Java virtual machine and Java libraries that embody just the essential capabilities of each kind of device. As device manufacturers develop new features in their devices, or service providers develop new and exciting applications, these minimal configurations can be expanded with additional libraries that address the needs of a particular market segment. To support this kind of customizability and extensibility, two essential concepts are defined by the J2ME environment:

  • Configuration. A J2ME configuration defines a minimum platform for a "horizontal" category or grouping of devices, each with similar requirements on to-tal memory budget and processing power. A configuration defines the Java language and virtual machine features and minimum class libraries that a device manufacturer or a content provider can expect to be available on all devices of the same category.
  • Profile. A J2ME profile is layered on top of (and thus extends) a configuration. A profile addresses the specific demands of a certain "vertical" market segment or device family. The main goal of a profile is to guarantee interoperabil-ity within a certain vertical device family or domain by defining a standard Java platform for that market. Profiles typically include class libraries that are far more domain-specific than the class libraries provided in a configuration. One device can support multiple configurations.
Configurations and profiles are discussed in more detail below. Both configurations and profiles use the capabilities of the Java virtual machine (JVM), which is considered to be part of the configuration. The virtual machine usually runs on top of a host operating system that is part of the system software of the target device. The high-level relationship between the different software layers—the JVM, configuration, profiles and the host operating system—is illustrated in Figure 2.2....
Read More Show Less

Table of Contents

1 Introduction 1
2 Overview of Java 2 Platform, Micro Edition (J2ME) 7
3 Goals, Requirements, and Scope 23
4 Connected Limited Device Configuration 39
5 CLDC Libraries 57
6 Mobile Information Device Profile 73
7 MIDP Application Model 79
8 MIDP User Interface Libraries 89
9 MIDP High-Level User Interface - Screen 111
10 MIDP High-Level User Interface - Form 129
11 MIDP Low-Level User Interface Libraries 149
12 MIDP Game API 173
13 MIDP Sound API 197
14 MIDP Persistence Libraries 221
15 MIDP Networking and Serial Communications 243
16 Secure Networking 277
17 Event-Driven Application Launch 289
18 Security for MIDlet Suites 305
19 MIDlet Deployment 323
20 Additional MIDP APIs 339
21 Summary 349
References 353
App. A CLDC Application Programming Interface 355
App. B MIDP Application Programming Interface 391
Index 425
Read More Show Less


In the past five years, Sun has collaborated with major consumer device manufacturers and other companies to create a highly portable, secure, small-footprint Java™ application development environment for resource-constrained, wireless consumer devices such as cellular telephones, two-way pagers, and personal organizers. This work started with the development of a new, small-footprint Java virtual machine called the K Virtual Machine (KVM). Two Java Community Process (JCP) standardization efforts, Connected, Limited Device Configuration (CLDC) and Mobile Information Device Profile (MIDP), were then carried out to standardize the Java libraries and the associated Java language and virtual machine features across a wide variety of consumer devices.

The first round of the CLDC and MIDP standardization efforts took place during the fall of 1999 and spring of 2000. Twenty-four companies participated in the CLDC 1.0 and MIDP 1.0 standardization efforts directly, and more than five hundred companies and individuals participated indirectly by sending feedback while the standardization efforts were in progress. Major consumer device companies such as Motorola, Nokia, NTT DoCoMo, Palm Computing, Research In Motion (RIM), and Siemens played a key role in these efforts.

After their first release, the CLDC 1.0 and MIDP 1.0 standards have become very popular. The deployment of real-world, Java-enabled wireless devices began in 2000, and the deployments accelerated rapidly in 2001 and 2002, approaching exponential growth. It has been estimated that over 50 million devices supporting the CLDC and MIDP standards were shipped in 2002, and the number is likely to be at least twice as large in 2003. As a result of the widespread acceptance of these standards, major business opportunities are now emerging for Java application developers in the wireless device space.

The second round of the CLDC and MIDP standardization efforts was started in the fall of 2001. The goal of the CLDC 1.1 and MIDP 2.0 efforts was to expand on the success of the original standards, refine the existing feature set, and introduce additional APIs, while keeping a close eye on the strict memory limitations that still constrain the design of wireless devices. More than 60 companies were directly involved in the development of the CLDC 1.1 and MIDP 2.0 specifications, reflecting the broad acceptance and adoption of these standards in the wireless industry.

This book intends to make the results of the standardization work in the wireless Java technology area available to the wider software development community. At the high level, this book combines two Java Community Process Specifications, CLDC 1.1 (JSR 139) and MIDP 2.0 (JSR 118), and presents them as a single monograph in a way that the corresponding Java Community Process (JCP) Specifications cannot accomplish by themselves. We have added a general introduction to the Java 2 Platform, Micro Edition (J2ME™), provided more background material, and included a number of small applications to illustrate the use of CLDC and MIDP in the real world. We also provide some guidelines and instructions for getting started with Java 2 Platform, Micro Edition.

A reference implementation of the software discussed in this book is available from Sun Microsystems under the Sun Community Source License (SCSL).

Intended Audience

The book is intended for software developers, content providers, and other professionals who want to develop Java™ software for resource-constrained, connected devices. The book is also targeted to consumer device manufacturers who want to build small Java Powered™ devices and would like to integrate a compact Java application development platform in their products.

Objectives of This Book

This book is the definitive statement, "from the source," about the key specifications for Java Powered™ wireless devices. As such, this book intends to

  • provide an overview of Java™ 2 Platform, Micro Edition (J2ME™ ),
  • provide a general introduction to the application development platforms defined by the J2ME standardization efforts,
  • explain the technical aspects of the J2ME Connected, Limited Device Configuration version 1.1 (CLDC 1.1),
  • explain the technical aspects of the J2ME Mobile Information Device Profile version 2.0 (MIDP 2.0),
  • provide sample programs to illustrate the use of CLDC and MIDP, and
  • help you get started in writing your own J2ME applications.

How This Book Is Organized

The topics in this book are organized as follows:

  • Chapter 1, "Introduction," provides a context for Java 2 Micro Edition and the CLDC and MIDP specifications.
  • Chapter 2, "Overview of Java 2 Platform, Micro Edition (J2ME(TM))," provides an overview of Java 2 Micro Edition, its key concepts and components.
  • Chapter 3, "Goals, Requirements, and Scope," defines the goals, requirements, and scope of the CLDC and MIDP standardization efforts.
  • Chapter 4, "Connected Limited Device Configuration," introduces the CLDC standardization effort and summarizes the supported Java programming language and virtual machine features compared to the Java 2 Platform, Standard Edition.
  • Chapter 5, "CLDC Libraries," introduces the Java class libraries defined by the CLDC Specification.
  • Chapter 6, "Mobile Information Device Profile," introduces the MIDP standardization effort.
  • Chapter 7, "MIDP Application Model," introduces the MIDlet application model defined by the MIDP Specification.
  • Chapter 8, "MIDP User Interface Libraries," introduces the user interface libraries defined by the MIDP Specification.
  • Chapter 9, "MIDP High-Level User Interface - Screen," introduces the part of the MIDP high-level user interface revolving around the Screen class.
  • Chapter 10, "MIDP High-Level User Interface - Form," introduces the part of the MIDP high-level user interface revolving around the Form class.
  • Chapter 11, "MIDP Low-Level User Interface Libraries," introduces the low-level user interface libraries defined by the MIDP Specification.
  • Chapter 12, "MIDP Game API," introduces the game API defined by the MIDP Specification.
  • Chapter 13, "MIDP Sound API, introduces the sound API defined by the MIDP Specification.
  • Chapter 14, "MIDP Persistence Libraries," introduces the record management system (RMS) defined by the MIDP Specification.
  • Chapter 15, "MIDP Networking and Serial Communications," introduces the libraries for networking and serial communications defined by the MIDP Specification.
  • Chapter 16, "Secure Networking," introduces the protocols for secure networking defined by the MIDP Specification.
  • Chapter 17, "Event-Driven Application Launch," introduces the protocols for launching MIDlets defined by the MIDP Specification.
  • Chapter 18, "Security for MIDlet Suites," introduces the security protocols for MIDlet suites defined by the MIDP Specification.
  • Chapter 19, "MIDlet Deployment," introduces the mechanisms for transferring a MIDlet to a wireless device.
  • Chapter 20, "Additional MIDP APIs," introduces some additional MIDP application programming interfaces (APIs), such as Timers.
  • Chapter 21, "Summary," summarizes the messages of this book.
  • "References" provides bibliographic references.
  • Appendix A, "CLDC Application Programming Interface," contains the application programming interface documentation in Almanac format for CLDC.
  • Appendix B, "MIDP Application Programming Interface," contains the application programming interface documentation in Almanac format for MIDP.

Related Literature and Helpful Web Pages

The Java™ Language Specification, Second Edition, by James Gosling, Bill Joy, Guy Steele and Gilad Bracha. Addison-Wesley, 2000, ISBN 0-201-31008-2

The Java™ Virtual Machine Specification, Second Edition, by Tim Lindholm and Frank Yellin. Addison-Wesley, 1999, ISBN 0-201-43294-3

Programming Wireless Devices with the Java 2 Platform, Micro Edition, First Edition, by Roger Riggs, Antero Taivalsaari, and Mark VandenBrink. Addison-Wesley, 2001, ISBN 0-201-74627-1

MIDP 2.0 Style Guide by Cynthia Bloch and Annette Wagner. Addison-Wesley, 2003, ISBN 0-321-19801-8

Connected, Limited Device Configuration Specification, version 1.0

Connected, Limited Device Configuration Specification, version 1.1

Mobile Information Device Profile Specification, version 1.0

Mobile Information Device Profile Specification, version 2.0

Java 2 Micro Edition Product Web Page

Connected, Limited Device Configuration (CLDC) Product Web Page

Mobile Information Device Profile (MIDP) Product Web Page

J2ME Wireless Toolkit Product Web Page

Web Pages for This Book

Addison-Wesley Page

Sun Microsystems Page


Read More Show Less

Customer Reviews

Average Rating 4
( 1 )
Rating Distribution

5 Star


4 Star


3 Star


2 Star


1 Star


Your Rating:

Your Name: Create a Pen Name or

Barnes & Review Rules

Our reader reviews allow you to share your comments on titles you liked, or didn't, with others. By submitting an online review, you are representing to Barnes & that all information contained in your review is original and accurate in all respects, and that the submission of such content by you and the posting of such content by Barnes & does not and will not violate the rights of any third party. Please follow the rules below to help ensure that your review can be posted.

Reviews by Our Customers Under the Age of 13

We highly value and respect everyone's opinion concerning the titles we offer. However, we cannot allow persons under the age of 13 to have accounts at or to post customer reviews. Please see our Terms of Use for more details.

What to exclude from your review:

Please do not write about reviews, commentary, or information posted on the product page. If you see any errors in the information on the product page, please send us an email.

Reviews should not contain any of the following:

  • - HTML tags, profanity, obscenities, vulgarities, or comments that defame anyone
  • - Time-sensitive information such as tour dates, signings, lectures, etc.
  • - Single-word reviews. Other people will read your review to discover why you liked or didn't like the title. Be descriptive.
  • - Comments focusing on the author or that may ruin the ending for others
  • - Phone numbers, addresses, URLs
  • - Pricing and availability information or alternative ordering information
  • - Advertisements or commercial solicitation


  • - By submitting a review, you grant to Barnes & and its sublicensees the royalty-free, perpetual, irrevocable right and license to use the review in accordance with the Barnes & Terms of Use.
  • - Barnes & reserves the right not to post any review -- particularly those that do not follow the terms and conditions of these Rules. Barnes & also reserves the right to remove any review at any time without notice.
  • - See Terms of Use for other conditions and disclaimers.
Search for Products You'd Like to Recommend

Recommend other products that relate to your review. Just search for them below and share!

Create a Pen Name

Your Pen Name is your unique identity on It will appear on the reviews you write and other website activities. Your Pen Name cannot be edited, changed or deleted once submitted.

Your Pen Name can be any combination of alphanumeric characters (plus - and _), and must be at least two characters long.

Continue Anonymously
Sort by: Showing 1 Customer Reviews
  • Anonymous

    Posted September 29, 2003

    Upgrade to MIDP 2 and CLDC 1.1

    The market for small devices (cellphones, PDAs, watches,...) with computational ability, but much less so than a standard PC or laptop is potentially vast. No one disputes this. Its allure is enhanced by there being no overly dominant player hoovering up over 50% of the profits, like Microsoft and Intel collectively in PCs. Logically, Sun sees growth here and this book is part of its frenetic rollout. It differs from the first edition because of significant upgrades to the 2 standards its describes. The Connected Limited Device Configuration (CLDC) went from version 1 in 1999 to 1.1 in 2002. It added more features that the book describes in detail. Basically, they give a richer compatibility with standard java (J2SE). The other standard, Mobile Information Device Profile (MIDP) went from version 1 to 2 in 2002. To developers the key additions were APIs for sound and games. In retrospect, MIDP 1 was indeed primitive, to lack these. Commercially, the MIDP 2 changes in the book may be more important than the CLDC changes. It means that you can now develop games and other applications using sound, at a high enough level of abstraction that they can be run on a broader range of hardware. Well at least that is the idea. I have not done so. But the book's explanation seems logical and thorough enough to make this plausible. Undoubtedly, if you and others follow this path, gaps or insufficiencies will be found, leading to the next increments of the standards. If you are still clutching the first edition of this book, or any other book that only covers CLDC 1 or MIDP 1, then drop it. Obsolete. Upgrade here.

    Was this review helpful? Yes  No   Report this review
Sort by: Showing 1 Customer Reviews

If you find inappropriate content, please report it to Barnes & Noble
Why is this product inappropriate?
Comments (optional)