Chapter 3: Java 2 Micro Edition for Wireless Enterprise Applications

Chapter 3: Java 2 Micro Edition for Wireless Enterprise Applications

Kin Choong Yow, Nanyang Technological University,


Nadia Nalaningrum Moertiyoso, Hewlett-Packard


Advancements in wireless technologies have made it possible to build wireless enterprise applications. An enterprise application calls for challenging requirements such as two-way data transfer, complex business logic, and multiple system users. These applications will make great impact to the operations of a company that will result in the increase of the company's revenue.This chapter examines and develops one enterprise scenario, a customer support system, using Java 2 Micro Edition (J2ME). J2ME allows applications to be executed locally using a mobile device's processing capacity and resources. We outline the design of a relational database to store frequently accessed data and describe the usage of XML for data exchange for better interoperability with back-end systems. Extensions to mobile commerce (m-commerce) are also considered . Bank account information and financial transaction instructions are treated as data to be sent over the wireless network. However, as in the case of e-commerce, the security of the transaction is the primary concern and some cryptography techniques need to be used.


For the last couple of years , the wireless industry has been experiencing tremendous growth. Wireless devices have become more intelligent and are providing a new notion of communication. It is now possible to conduct business using a wireless network that will greatly improve the speed and quality of the business. This gives rise to mobile commerce (m-commerce), a transaction with a monetary value that is conducted via a mobile telecommunications network.

Wireless enterprise applications will bring great impact in the workflow, work efficiency, and user convenience, which will result in increasing a company's revenue. Examples of business decisions across the wireless Internet are:

  • A sales manager will be able to browse and download the latest price and stock availability of products during the journey to the client meeting.

  • Doctors and medical workers will be able to view a patient's history of illness , medication , and allergies using their handheld device.

  • Support engineers , couriers, and delivery services will be able to manage their schedule better by organizing their orders on their cell phones. The headquarters will also be able to monitor their workers in the field.

The purpose of this chapter is to discuss the issues concerning the development of wireless enterprise applications using Java 2 Micro Edition (J2ME), a platform that allows applications to be executed locally using a mobile device's processing power and resources. This chapter will explain what J2ME is and discuss the guidelines and technical aspects to implement wireless enterprise applications using J2ME. For illustration, one case study, a customer support management system, will be described in detail.


Introduction to Java 2 Micro Edition

After introducing Java 2 Standard Edition (J2SE) and Java 2 Enterprise Edition (J2EE), Sun recently added the Java 2 Micro Edition (J2ME) (Sun Microsystems, 2002). J2ME is designed to run on consumer devices and electronic appliances, including wireless devices such as cell phones and Palm PDAs (Raju, 2000). J2ME provides a way to exploit the processing power on the mobile device better by running the code on the device itself. Therefore, it provides better network implementation, better graphical user interface, and local database management.

The J2ME defines the following set of tools and APIs that can be used with consumer devices:

  1. Java virtual machine suitable for consumer devices

  2. Libraries and APIs that are suitable for consumer devices

  3. Tools for development, deployment, and device configuration

Figure 1: Java technology map

Devices implement a complete software stack , which usually consists of a configuration, a profile, and optional APIs. Current J2ME cell phones usually implement the software stack shown in Figure 2.

Figure 2: Example of J2ME stack

In the future, J2ME cell phones could implement the stack shown in Figure 3, which includes the Mobile Media API (MMAPI). The MMAPI enables playback and capture of audio and video multimedia data.

Figure 3: Example of future J2ME stack

The Java virtual machine for consumer devices is known as Kilo Virtual Machine (KVM), which is a complete Java runtime environment for small devices. KVM was designed to be small, with a static memory footprint of 40 ‚ 80 kilobytes. KVM is derived from a research system called Spotless at Sun Microsystems Laboratories.

J2ME Profiles and Configurations

J2ME is divided into configurations and profiles (Ashri et al., 2001). Configurations are specifications that detail a virtual machine and a base set of APIs that can be used with a certain class of device. A profile builds on a configuration but adds more specific APIs to make a complete environment for building applications. While a configuration describes a JVM and a basic set of APIs, it does not by itself specify enough detail to build complete applications.


Mobile devices such as cell phones, pagers , organizers, etc., are diverse in form, functionality, and features. For these reasons, the J2ME supports minimal configurations of the Java Virtual Machine and APIs that capture the essential capabilities of each kind of device (Feng & Zhu, 2001). A J2ME configuration defines a set of horizontal APIs for a family of products that have similar requirements.

A configuration specifies:

  1. the Java programming features supported,

  2. the Java virtual machine features,

  3. the Java libraries and APIs supported.

Currently, there is one standard configuration: the Connected Limited Device Configuration (CLDC).


A profile is a set of vertical APIs that reside on top of a configuration to provide domain-specific capabilities. Currently, there is one profile defined and implemented, the Mobile Information Device Profile (MIDP; Sun Microsystems, 2001). Other profiles, which are in the works, include the PDA profile and the RMI profile.

Table 1 shows the current and anticipated configurations, profiles, and APIs.

Table 1: J2ME profiles and APIs


JSR 30

JSR 139

CLDC 1.0

Connected, Limited Device Configuration

JSR 36

CLDC 1.1

Connected, Limited Device Configuration 1.1



Connected Device Configuration

JSR 37

JSR 118

MIDP 1.0

Mobile Information Device Profile

JSR 75

MIDP 2.0

Mobile Information Device Profile 2.0

JSR 46


PDA Profile

JSR 129


Foundation Profile

JSR 62


Personal Basis Profile

JSR 134


Personal Profile



Game Profile

JSR 66

JSR 80


RMI Optional Package

JSR 82



JSR 120


Java APIs for Bluetooth

JSR 135


Wireless Messaging API

JSR 169


Mobile Media API

JSR 179


JDBC Optional Package for CDC/FP

JSR 180


Location API for J2ME

JSR 184



Comparison With Other Technologies

Currently, there are two prevalent technologies for developing applications on cell phones:

  1. SMS (Short Message Service)

  2. Browser-based programming (WAP and NTT DoCoMo i-Mode)

Short Message Service (SMS)

Short Message Service allows users to send and receive text messages to and from cell phones. Originally offered in 1992, SMS initially experienced a slow adoption rate. However, since reaching the 20% market penetration rate, SMS usage has grown exponentially. The number of SMS messages has nearly doubled every half a year since 1998 (GSM Association, 2001a).

Each SMS message can contain up to 160 characters . The application is customizable using SIM toolkit technology and ideal for one-to-one or one-to-few information pushing. However, SMS is not ideal for implementing an enterprise application since it can only support simple applications. The application can only be equipped with very limited logic, mainly text processing, and does not cater to complex enterprise solutions. Also, the current messaging technology does not guarantee that the packet will arrive at a certain time. However, SMS messages are ideal for delivering small, periodic information such as stock quotes, weather info , advertising, etc.

Browser-based programming

WAP. (now Open Wave), a merged venture with, first introduced WAP in 1995. WAP is an open standard that enables easy delivery of information and services to mobile users. WAP is intended to address the need to access the Internet from handheld devices such as cell phones and PDAs. It defines a set of standard components that enable communication between mobile terminals and network servers, including the WAP programming model. WAP has received wide support in the wireless industry.

NTT DoCoMo i-Mode. i-Mode was first introduced by NTT DoCoMo in Japan (, 2002). This technology competes with WAP. It offers a similar mechanism to allow users to access the Internet from their wireless devices over a packet-switched network. The majority of i-Mode users are in Japan and other Asian countries .

Study of J2ME Versus WAP in Enterprise Application

J2ME and WAP are complementary technologies. J2ME is not going to replace the WAP and i-Mode technologies. Both the WAP technology and i-Mode technology are comparable to HTML and Web browsers on desktop computers, while J2ME is comparable to desktop Java applications. However, in the enterprise application situation, J2ME is found to be superior to WAP.

Limitations of Browser-Based Technology

WAP and i-Mode are limited in some ways, including:

  • Network disconnections : Mobile device communication over wireless networks tends to suffer from greater occurrences of disconnections due to a variety of problems, such as limited cell coverage, loss of signal, limited battery life, etc. Current frameworks only provide partial support for disconnected operations.

  • Constant airtime : WAP application requires constant airtime in order to operate . When combined with the previous point, this may cause disruptions in the application's usage. This constant airtime requirement is also economically inefficient.

  • Lack of security : The infrastructure of WAP forces the information to be passed into a WAP Gateway before it is presented to a cell phone. Therefore, there is a security loophole in the architecture since the WAP Gateway is usually controlled by a third party (network carrier). In addition, security issues may arise during the translation of pages from the server to the WAP Gateway.

  • Primitive user interface : The user interface for WAP-enabled sites is primitive when compared to traditional Web sites. Devices that might be capable of displaying richer graphical user interface (GUI) screens through higher screen resolution are not being exploited.

As the industry matures, users demand more secure wireless applications for mobile commerce transactions, more interactive applications such as video games , and more sophisticated applications for client/server enterprise applications (Kirkley, 2001).

Benefits of J2ME

J2ME has the following benefits:

  • Local computing power : Browser-based applications can often be an adequate solution for constructing software for devices, allowing Web access with minimal configuration. However, it is more valuable to be able to exploit the device's resources more by executing code on the device's processor and using the device's memory to run the application locally.

  • Multithreading : J2ME allows an application to use multithreading. This provides a mean for application developers to create a more complex logic.

  • User personalization : Browser-based applications often lack the sophistication in user interface compared to applications that take greater advantage of local operating systems. This sophistication can be leveraged by J2ME with better manipulation of device-side services.

  • Offline operation : J2ME provides a solution that can run on or off the network, something that a browser solution can do only in a very unsophisticated way with local browser page caching.

  • Lower network usage and server load : In a WAP-based solution, the server is responsible for generating display markup. This requires a roundtrip every time the interface changes. In contrast, an MIDP client's interface is contained within the device, so it can operate even when disconnected.

  • Security : J2ME offers an enhanced security model. It provides connection end-to-end from client device to company servers and does not require gateways such as in WAP.

  • Connectivity with distributed system : J2ME provides a better way to talk to back-end systems. Applications written in J2ME are able to talk in XML, a language that is suitable for cross-platform and distributed system application.