This article surveys the state of the Java Platform, Micro Edition (Java ME). You'll find important background information and explanations of terminology that you need to understand. It complements Introduction to Mobility Java Technology and the Java ME specifications, both of which you should take the time to read. Contents
A Brief History of Java Technology
The Java programming language was originally developed for programming consumer electronic devices, but over the years it evolved into a set of technologies used primarily to develop desktop- and server-based applications. In many ways, today's Java ME platform is a return to the origins of Java technology. It all started in the early 1990s with the Green Project and the Oak programming language, later renamed Java. Today's Java ME is the descendant of earlier platforms for small devices created by Sun Microsystems: the Oak part of the Green Project (early 1990s), Java Card (1996), PersonalJava (1997), EmbeddedJava (1998), and more recently, the Spotless System (PDF) and the K virtual machine (1999). Today, the Java ME platform targets high- and low-end electronic devices with a single Java platform. Java Card, described later in this article, remains an important independent Java platform, distinct from Java ME, based on smart cards. Java Technology Editions
A typical enterprise application may well take advantage of all three editions, with Java EE technology-based applications on the server side providing services to applications based on Java SE and Java ME technology on the client side. Separating the Java platform into these editions allows for sharper focus on the varying needs of developers working in different target environments, and it enables the editions to evolve in different yet complementary directions. How Java Technology Evolves
Java technology evolves through the Java Community Process (JCP) program. The JCP is an open, community-based standards organization with a formal process for defining and revising Java technology specifications. JCP program members are individuals and organizations that share a common interest in seeing Java technology continue to evolve to meet market needs successfully. Even though the JCP is an open, community-based process, Sun Microsystems retains all Java technology-related trademarks and remains the ultimate authority for the Java platform. The JCP process is straightforward: JCP members who want to extend the Java platform submit a formal proposal called a Java Specification Request (JSR), which then proceeds through a well-defined life cycle of drafts, reviews, and approval ballots. You can subscribe to the JCP mailing list to receive regular updates on JSRs and on JCP procedures, participate in public reviews by responding to requests for public comment, or even become a member of an expert group that shepherds a JSR through the development process. To stay current with Java ME developments, keep up with the relevant JSRs. To start, read this Introduction to Mobility Java Technology and visit the JCP Java ME technology page. The JCP page lists more than 80 relevant JSRs, both those that have earned final approval and those that are still in process. Your contributions help ensure that Java technology continues to satisfy market needs. Overview of the Java ME Platform
Java ME does not define a new programming language. Rather, it adapts existing Java technology to handheld and embedded devices. Java ME maintains compatibility with Java SE wherever feasible. To address the stricter limitations of devices, Java ME sometimes replaces Java SE APIs and adds new interfaces. But the evolution of Java ME is as much about omitting unnecessary parts of the Java SE and Java EE platforms as it is about overriding and adding new ones. Java ME is conceptually organized as a stack consisting of four software layers, as shown in Figure 1. To take fullest advantage of the Java ME platform, developers base their applications on a configuration appropriate to the category of target devices, a profile that supports the application's basic functionality, and optional packages or APIs that support needed specialized functions such as messaging or multimedia.
Let's look at Figure 1, starting at the bottom. The configuration consists of the virtual machine (VM) and core Java APIs. Above the configuration are profiles and the application environment, which consist of the APIs and application environment such as the Mobile Information Device Profile, the Java Technologies for Wireless Industry, and the Mobile Service Architecture clarifications. Next on the stack are the mandatory, conditionally mandatory, or optional packages or APIs. These include vendor-specific classes that are not part of the Java ME standard but that extend or provide functionality that is specific to a given device, such as APIs to control radio transceivers. At the top of the stack are the Java ME applications themselves. This article will discuss each layer in depth, but let's first look at where Java ME sits with respect to other Java technologies for handheld and embedded devices. Java Technologies for Handsets, Smart Cards, and Embedded Devices
Java ME has evolved into an organized architecture for electronic devices, including sets of Java APIs for high-end PDAs and embedded devices, as well as for more constrained devices such as cell phones, low-end PDAs, and headless devices -- those without display or user interface (UI) facilities. Today the Java technologies for handsets, smart cards, and embedded devices are split as illustrated in Figure 2.
Java ME comprises the Connected Limited Device Configuration (CLDC) and the Connected Device Configuration (CDC):
Java Card technology consists of the Java Card VM, the Java Card framework, and the security and remote invocation APIs. Java SE for Embedded is Java SE technology with special support, functionality, and a licensing model for embedded platforms. It has a smaller footprint Java SE technology-based runtime, memory optimizations, and other savings, access to read-only memory (ROM) or compact flash, and support for embedded CPUs and operating systems. It replaces EmbeddedJava and PersonalJava. Evolving the Java Technologies Through MSA
The Mobile Service Architecture (MSA) specification defines a common architecture and programming platform for wireless handsets. Like its predecessor, Java Technology for the Wireless Industry (JSR 185), MSA is an umbrella Java specification, a collection of familiar, updated, and new JSRs that cooperate to support applications with a wide range of standardized capabilities. Two flavors of MSA are defined: The basic MSA (JSR 248) addresses CLDC-based platforms, and the MSA-Advanced (JSR 249) addresses CDC-based platforms. The architectures define a comprehensive structure of APIs aimed at facilitating development and deployment of the widest possible variety of applications, in a form that will be easily portable across the broadest possible spectrum of mobile devices. The basic MSA defines two stacks: a full MSA stack that comprises 16 JSRs and a subset of eight JSRs, as illustrated in Figure 3.
Some of the JSRs are mandatory, and others are conditionally mandatory. To comply with MSA, an implementation must support a mandatory JSR or one that is conditionally mandatory, that is, one that becomes mandatory when relevant conditions are true. A typical example of the latter is JSR 82, the Bluetooth API, which is not always required but must be supported if the device claims to support the Bluetooth wireless technology. For an introduction to MSA, see the article The Mobile Service Architecture Specification. Configurations
A configuration, at the bottom of the Java ME organization stack shown in Figure 1, defines a basic lowest-common-denominator Java runtime environment. This includes the VM and a set of core classes derived primarily from the Java SE platform. Each configuration is geared for a broad family of constrained devices with some type of network connectivity. As this article mentioned earlier, two configurations have been defined: the Connected Limited Device Configuration (CLDC) and the Connected Device Configuration (CDC). CLDC is a subset of CDC, as Figure 4 shows.
CDC includes all the classes defined by CLDC, including any new ones not included in the Java SE platform, such as the Generic Connection Framework. The Connected Limited Device Configuration (CDC) CLDC does not require a lot of resources. It supports devices with 16-bit or 32-bit processors with at least 160 KB of persistent memory and at least 32 KB of volatile memory, for a total of 192 KB. Power consumption is low, and devices are typically battery-powered. Network connectivity may be over an intermittent, slow-speed connection. At the heart of this configuration is a Java virtual machine with some Java SE capabilities removed. For example, CLDC does not support class finalization or thread groups. For a list of all the restrictions, visit the CLDC product page. CLDC defines a subset of the standard core Java language packages familiar to Java SE developers, and it adds classes tailored for constrained devices. In addition, CLDC has introduced the streamlined Generic Connection Framework package,
Note that CLDC 1.1, JSR 139, has superseded the original CLDC 1.0 specification, JSR 30. Differences Between CLDC 1.0 and 1.1
For more information, see the CLDC product page. The Connected Device Configuration (CDC) Devices that support CDC have 32-bit processors, typically ARM-based devices, at least 2 MB of main memory and 2.5 MB of ROM, and some type of network connectivity. At the heart of this configuration is a Java VM such as the CDC HotSpot Implementation, with full Java SE capabilities. CDC is a superset of CLDC. It includes all the classes defined by the CLDC, including any new ones not included in Java SE, such as the Generic Connection Framework. CDC includes many more core Java SE classes than does CLDC, making it a more familiar environment for experienced Java SE programmers. Table 2 summarizes the packages in CDC.
CDC release 1.0 was introduced as JSR 36. More recently, CDC 1.1 was introduced as JSR 218. Differences Between CDC 1.0 and 1.1 For more information, see the CDC product page. Profiles
Configurations do not provide classes for managing the application life cycle, for driving the UI, for maintaining and updating persistent data locally in the device, or for accessing securely information that is stored on a network server. Instead, that type of functionality is provided by the profiles or by optional packages. A profile adds domain-specific classes to the core set of classes provided by the configuration, classes that are geared toward specific uses of devices and provide functionality missing from the underlying configuration. At this writing, there are six profiles, three based on CLDC and three on CDC. The three standard CLDC-based profiles are the following:
Not all these profiles are restricted to mobile handsets, with the latter targeted to digital set-top boxes. The three profiles based on CDC are the following:
Figure 5 shows how profiles relate to their underlying configurations and to each other.
Multiple profiles can exist on top of the same configuration, as in the case of MIDP and IMP. They can also depend on or build on each other. For example, the Personal Profile extends the Personal Basis Profile, which in turn depends on the Foundation Profile. Expect more profiles to appear as Java ME technology evolves. CLDC-Based Profiles IMP promises to do for headless devices -- that is, those without display or UI facilities, such as vending machines, industrial devices, and security systems -- what MIDP has done for smart cell phones and low-end PDAs. There are two versions of IMP: Version 1.0 is based on MIDP 1.0, and the Next Generation (NG) version is based on MIDP 2.0. Use of CLDC is not restricted to such devices, however. As Figure 6 illustrates, the Digital Set Top Box Profile (JSR 242) is a CLDC-based profile specifically defined for the cable market. Also referred to as OnRamp, this profile is based on a subset of the PersonalJava technology-based OpenCable Application Platform (OCAP), which defines a set of APIs for the development of applications for set-top boxes and similar devices.
OnRamp is quite large, with 31 Java packages and approximately 1500 APIs. But it is not as large as its superset, OCAP, which has approximately 8000 APIs. These include a subset from the Personal Basis Profile such as support for the Abstract Window Toolkit (AWT), Xlet, file access, and network APIs, as well as support for several media-related interfaces including Java TV, Java Media Framework (JMF), Digital Audio Visual Council (DAVIC), Home Audio/Video Interoperability (HAVI), Digital Video Broadcasting (DVB), and as previously mentioned, the OpenCable Application Platform (OCAP). MIDP and IMP are so similar to each other that we'll review them together. As the first Java ME profile, MIDP is the most mature and widely adopted, with millions of deployments all around the world, primarily on PDAs, cell phones, and other handheld communicators. IMP's targets are devices with characteristics similar to those
of MIDP devices but with little or no capabilities for UI: headless
embedded devices in vending machines, industrial applications, and
security systems. First defined by JSR
195, IMP borrows all of its functionality from MIDP, including
application-management, storage, networking, security, and timer
APIs. IMP 1.0 is a strict subset of MIDP 1.0, excluding the APIs for
UI, specifically MIDP 1.0 was introduced in JSR 37 and is still in wide use. MIDP 2.0, defined by JSR 118, enhanced the profile's capabilities. To the original APIs for networking, UIs, local persistence, and MIDlet life cycle, MIDP 2.0 added new networking APIs to support TCP socket streams and UDP datagrams,as well as serial, push-initiated, and secure connections. Other additions include a robust security API and policy, as well as APIs for sound and gaming. The MIDP 2.0 profile specification also includes an update of the Over-the-Air (OTA) User-Initiated Provisioning recommendation that was originally defined as an addendum to the MIDP 1.0 specification, which describes how users can discover and download applications over wireless networks. Even though the MIDP specification indicates the use of CLDC 1.0, nothing precludes use of CLDC 1.1 as the base for either version of MIDP. At this writing, IMP is undergoing its first revision. JSR 228, also known as IMP-NG, is IMP's next generation. It will take advantage of MIDP 2.0's new security and networking types and APIs, and other APIs such as
Table 4 summarizes the packages available in both versions of MIDP and in IMP 1.0.
For more information on the profiles based on CLDC, read the articles What's New in MIDP 2.0 and The Information Module Profile. CDC-Based Profiles
The Foundation Profile includes all the classes in CDC and adds more Java SE classes, security features, and other APIs. The Personal Basis Profile includes all of CDC and Foundation Profile, and then adds a minimum core set of UI classes, among other features. The Personal Profile incorporates all of CDC, Foundation Profile, and Personal Basis Profile, and it provides a more complete set of the Abstract Window Toolkit (AWT) API, including its heavyweight APIs and support for applets. The Foundation Profile Because the Foundation Profile does not provide any UI classes -- no AWT, no Swing -- it is the profile of choice for small devices that don't need a UI, such as headless, dedicated, connected, and embedded devices. Table 5 summarizes the Foundation Profile's Java packages.
Version 1.0 of the Personal Basis Profile was defined in JSR 129. More recently, version 1.1 was introduced in JSR 217, which is still in progress. Differences Between Foundation Profile 1.0 and 1.1 The Personal Basis Profile
Version 1.0 of the Personal Basis Profile was defined in JSR 129. More recently, the Personal Basis Profile 1.1 was introduced in JSR 217, which is still in progress. Differences Between Personal Basis Profile 1.0 and 1.1 The Personal Profile The Personal Profile thus provides a more complete application environment and looks very similar to Java SE. It is aimed at devices that require advanced UI and secure network connectivity, such as high-end PDAs, set-top boxes, and other high-end appliances. Table 7 summarizes the Personal Profile Java packages.
Personal Profile 1.0 was defined in JSR 62. More recently, Personal Profile 1.1 was introduced in JSR 216, which is still in progress. Differences Between Personal Basis Profile 1.0 and 1.1 For a handy comparison of APIs in CDC and its profiles to the corresponding Java SE interfaces, see the CDC API Comparison (PDF). Optional Packages With optional packages taking over such burdens, profiles can concentrate on supporting only those capabilities that most or all devices in a class need. Profiles can supply the runtime environment, while optional packages supply specific kinds of functionality, some of which were not even envisioned when the profiles were designed. All Java ME optional packages are defined by the JCP, making them standard APIs. As the name implies, inclusion of these packages is optional. Some are mandatory, while others are conditionally mandatory as defined by the JCP. Still others are optional as defined by the handset manufacturers that may choose to include them in a particular product, or in extensible environments such as PDAs on which developers may elect to include them. For example, in a particular MIDP handset that has hardware support for Bluetooth, the Java APIs for Bluetooth (JSR 82) might be present. The number of optional packages is increasing, with some for CLDC environments, some for CDC, and some for both. Some are already approved, and many new ones are in the definition phase. For this purpose, the MSA specification defines a common architecture and programming platform for wireless handsets. Two flavors of MSA are defined: the basic MSA that addresses CLDC-based platforms, and MSA-Advanced that addresses CDC-based platforms. Java Card Technology
Java Card technology complements the Java ME platform. It slims down the Java platform for use within the severe memory and processing constraints of smart cards, a very specialized environment not suitable for general-purpose programming. A typical Java Card device has an 8- or 16-bit CPU running at 1 to 5 MHz and memory on the order of 1.2 K of RAM and 32 K of nonvolatile memory, typically EEPROM or flash. The Java Card platform consists of the Java Card Virtual Machine, the Java Card Framework, security and remote invocation APIs, and Extension APIs, as illustrated in Figure 8.
The Java Card specification, in version 2.2.2 at this writing, includes a carefully chosen subset of the Java programming language. It does not support large primitive data types such as long, double, float, strings, dynamic class loading, multithreading, and other features characteristic of Java technology. Java Card technology comes in three parts:
The Java Card Development Kit provides a reference implementation of the runtime environment and the VM, as well as other tools to help you develop applications based on Java Card technology, commonly called Java Card applets. Table 8 summarizes the Java technology APIs available in the Java Card specification.
Java Card applets commonly include digital IDs and secure storage, and they are often found on subscriber identity module (SIM) cards that are inserted in cell phones to hold telephone and user account information. Recently, Sun Microsystems introduced the concept of a protection profile, which defines a set of security requirements for the Java Card RE, the Java Card VM, the Java Card API Framework, and the on-card installer components. Its purpose is to help creators of Java Card technology-based products develop a secure Java Card platform and obtain high-level security certifications. Review the section on the Security and Trust Services API (SATSA) optional package for information on smart cards and security elements. For more information on the most compact of the Java platforms, see the Java Card technology product page and read the three-part series titled "An Introduction to Java Card Technology": Part 1, Part 2, and Part 3. Summary
The Java ME platform has been evolving into a complete runtime environment and numerous sets of APIs for developing Java technology-based applications for a wide variety of electronic devices. Java technology began with an embedded programming language for consumer devices that was ahead of its time -- the small devices available then simply did not have enough capacity. Instead, Java technology became a desktop-based general-purpose programming language and then evolved into a platform particularly useful for server-based enterprise applications. The Java ME platform brings the power of Java technology back to PDAs, mobile phones, and other handheld and embedded devices. At the heart of Java ME are the two configurations that define the core functionality of the platform for a family of devices: CLDC for the smallest devices and CDC for larger, more powerful devices. On top of the configurations, profiles add classes for building UIs, making network connections, and controlling application life cycles. The three CLDC-based profiles are MIDP, IMP, and the Digital Set Top Box Profile. The three CDC-based profiles are the Foundation Profile, Personal Basis Profile, and Personal Profile. Java ME also includes optional packages, sets of APIs that extend profiles by adding specific functionality that only some devices and applications need. Java Card technology is another Java platform in its own right, providing smart cards with a supercompact Java Card RE, VM, and programming interface. * Sun Microsystems renamed the Java technology products in June 2005: Java 2 Platform, Micro Edition (J2ME) is now called Java Platform, Micro Edition (Java ME). Java Platform, Standard Edition products later than J2SE 5.0 are now called Java SE. For more information, see the announcement of the name change. About the Author
C. Enrique Ortiz is a mobile technologist, software architect, developer, writer, and blogger. He has been author or co-author of many publications and is an active participant in the Java mobility community and in various Java ME Expert Groups. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
| ||||||||||||