Sun Java Solaris Communities My SDN Account Join SDN
 
Article

Integrated Java Technology for End-to-End m-Commerce

 

Client-Side Download | Server-Side Download | Demo Readme

In the last year, Java 2 Micro Edition (J2ME) and XML technologies increased in popularity. When used together, these technologies can be key architectural elements in end-to-end wireless solutions for PDAs and handheld devices, such as cell-phones and pagers. Using J2ME and XML technology also makes for a highly versatile end-to-end architecture. To explore this architecture, this article looks at:

  • The advantages of J2ME over conventional WAP technology in wireless-based enterprise and consumer applications, such as mobile commerce (m-commerce).

  • How you can benefit from Java and XML technology for extending an existing client/server infrastructure towards deploying m-commerce solutions.

  • How J2ME helps facilitate the growth of wireless portals.

You will also find a sample application, called "Mobile Resource Management System" or "m-RMS." It illustrates the kind of applications you can develop within the architecture presented in this article. m-RMS is a resource management and tracking system for Mobile Information devices such as PDAs and Java Phones. m-RMS uses J2ME (CLDC + MIDP) and XML technology and communicates wirelessly over TCP/IP to a backend Java 2 Enterprise Edition (J2EE) framework.

Why Wireless and Java Technology?

Wireless Access Protocol (WAP) is a result of continuous work to define an industry-wide standard for developing applications over wireless communication networks. The WAP Forum, originally founded by Ericsson, Motorola, Nokia, and Unwired PlanetWML, was formed to create global wireless protocol specification that works across differing wireless network technology types, for adoption by appropriate industry standards organization.

Wireless Markup Language (WML) is a markup language based on XML, and is used to specify content and user interface for narrow-band devices, including cellular phones and pagers. WML is designed with the constraints of small, narrow-band devices in mind. These constraints include:

  • Small display and limited user input facilities
  • Narrow band network connection
  • Limited memory and computational resources

J2ME technology specifically addresses the vast consumer space, which includes smart cards and pagers all the way to the set-top box, an appliance almost as powerful as a computer. Like the other Java technologies (Java 2 Standard Edition (J2SE) and J2EE), the J2ME platform maintains these advantages:

  • Built-in consistency across products in terms of running anywhere, any time, over any device
  • Portability of the code
  • Leveraging of the same Java programming language
  • Safe network delivery

Applications written with J2ME technology are upwardly scalable to work with the J2SE and J2EE platforms.

The Mobile Information Device Profile (MIDP) is a set of Java APIs which, together with the Connected Limited Device Configuration (CLDC), provides a complete J2ME application runtime environment targeted at mobile information devices, such as PDAs, cellular phones, and two-way pagers. The MIDP specification addresses issues such as user interface, persistence storage, networking, and application models.

There are many advantages to using Java technology in wireless devices over conventional solutions, but perhaps two of the most important advantages are security, and disconnected transaction with wireless synchronization.

  • Security is key. Today's WAP devices retrieve and display data via a microbrowser, which means they rely on gateways to convert between Internet-oriented protocols (such as TCP/IP and SSL), and the wireless network. This gateway between a mobile device and a back-end server can be a potential security breach. You might have SSL between your web server and gateway, but if you strip out SSL and put data into another security format (such as WAPs or WTLS), the data is potentially exposed on the carrier's network.
Because it's easy to write portable Java applications that work over HTTP, the new generation of Java technology mobile devices introduces a new level of end-to-end security to the wireless world. Because Java technology protects handheld devices, you can allow third-party application developers, who you don't know, to run applications in these devices.
  • Disconnected Access and Synchronization. Java technology mobile applications can run even when a device is disconnected or out of the coverage area. With Java technology-based applications you can run and interact with most of your applications on phones and handhelds in standalone mode, and later synchronize with the backend infrastructure. This is contrary to the WAP-enabled handsets, where you need to be connected all the time. If you're out of coverage, you're out of luck.

Other important advantages that Java technology offers the wireless space include:

  • Dynamic delivery of applications and services. Unlike most devices today, next-generation phones, PDAs, and pagers will be able to download applications safely in real time. Java technology lets you dynamically download new applications over the air, and then run them on any device.
  • Cross-platform compatibility. Because applications written with Java technology run on multiple devices, you can run identical services on your PDA, phone, or pager.
  • Enhanced user experience Because Java technology-based applications have richer graphics with faster interaction, developers can write richer and more useful applications than existing browser-based environments, such as WAP. And because graphics are generated locally, network bandwidth demand is also reduced.
  • Scalability and Performance Using Java technology on the client end allows users to work in standalone mode, which results in fewer users accessing the server at any given time. This in turn improves performance and scalability for the server, and reduces demand for network bandwidth.

A Java Technology Based end-to-end Architecture for m-Commerce

The end-to-end architecture proposed in this article for developing Java technology-based, integrated wireless m-commerce solutions for handheld devices consists of the following components:

  • Backend tier: this might be a database such as Oracle, a legacy system, a mainframe, or an Enterprise Information System (EIS).
  • Middleware tier: this is the application container that hosts Enterprise JavaBeans. It can also be, for instance, an IMAP server, a calendar server, a LDAP server, or a combination depending on the application requirements.
  • Web tier: this is a web server hosting JavaServer Pages, servlets, and the beans. It constitutes the wireless portal.
  • Client tier: this might be a standalone client implemented on J2ME for mobile devices or a WML/XHTML browser running on handheld devices.

The diagram below illustrates the architecture:

Architecture
Click image to enlarge

The architecture detailed here for handheld devices is not very different from existing solutions running on desktops and laptops. In fact, the same applications that conventionally run on desktops can be made accessible over TCP/IP and HTTPS, both wirelessly and securely, to mobile handheld devices by using J2ME and XML.

However, an important difference in the wireless world is that a handheld user must be able to work and interact with the application in standalone mode. This feature cannot be provided with traditional WML/WAP technology. Java technology enables standalone Java mobile applications to operate in disconnected or standalone mode.

Client Tier Configurations and Modes

The client tier runs in three broad configurations:

  • J2ME connection-on-demand client configuration for wireless devices
  • Browser client configuration for wireless devices
  • Browser client configuration for laptops and desktops

Depending on each configuration, the application can run in one or more of three modes:

  • Standalone
  • Wireline
  • Wireless

The three configurations and modes for the client are as follows:

  • J2ME connection-on-demand client architecture
    A standalone wireless application written over J2ME (CLDC + MIDP/PDAP) running on a wireless handheld device. In this configuration the user can work in standalone mode, wireline mode, or wireless mode. The user can also synchronize the data with the backend server either wirelessly or wireline.
  • Browser client, connected architecture
    JSP/WML pages rendered by a WML browser running on a wireless handheld device
    Note: The user cannot work in standalone mode in this configuration. The user can choose a HTTP-enabled WML browser written on J2ME, or a WML browser available natively on the handheld device from a variety of vendors like Avantgo or Palm.net among others.
  • Conventional, browser client connected architecture
    JSP/HTML pages rendered by a HTML browser running on a desktop/laptop. Although the user cannot work in standalone mode, this isn't an issue, because it is a wireline configuration.

All client modes communicate with the same portal server framework, which includes the web, middleware, and database or backend tier.

The following table details the technologies associated with the three client configurations and possible modes associated with each:

Features Configuration I
Connection on demand
Configuration II
Always Connected
Configuration III
Always Connected
Backend Server Technology J2EE
JSP, servlets, EJB (session and entity beans), JNDI, RMI over IIOP, JAXP, JDBC
J2EE
JSP, Servlets, EJB (session and entity beans), JNDI, RMI over IIOP, JAXP, JDBC
J2EE
JSP, servlets, EJB (session and entity beans), JNDI, RMI over IIOP, JDBC
Web Tier/ Portal Server JSP/XML (JAXP) JSP/WML JSP/HTML
Client User Interface MIDlet WML browser HTML browser
Client device Handheld device running J2ME (CLDC + MIDP) virtual machine Handheld device running a WML browser (J2ME based or native) Desktop/laptop
Client technology J2ME (CLDC, MIDP), XML, XML parser WML/WML script/CHTML HTML
Transport mechanism between server and client XML over HTTP/HTTPS WML/CHTML over HTTP/HTTPS/WAP/iMode HTML over HTTP/HTTPS
Wireless mode Yes, using any wireless modem with handheld device Yes, using any wireless modem with the handheld device Yes, using a wireless modem with laptop
Standalone mode/Synchronize Yes, the application allows the user to download information, work in standalone mode and upload/synchronize the new or modified information with the backend server. No No
Security Secure from end-to-end if HTTPS is used Potential for a security breach at the WAP gateway where protocol conversion is done. If no WAP gateway is used, complete security can be achieved end-to-end. Secure from end-to-end if secure protocols are used.

Configuration I: The web tier consists of servlets that generate XML formatted data, using JAXP. This data is sent to the J2ME client application over HTTP/HTTPS, parsed using an XML parser (NanoXML for example), and rendered by the J2ME GUI.

Configuration II: The web tier consists of JSPs that generate WML formatted data and are rendered by a WML browser. WML data can be sent on HTTP/HTTPS end-to-end if a HTTP WML browser is used. If the browser is a WAP browser running natively on the handheld device, the data needs to be sent partly on HTTP and partly on WAP via a WAP gateway. The WML browser can be a J2ME application or a native device WML browser.

Configuration III: This is the traditional mode and consists of JSPs that generate HTML formatted data rendered by a HTML browser, and sent over HTTP/HTTPS.

An alternate framework or architecture could be used at the web tier. In this framework, JSP pages can be generated during runtime, depending on the client device. However, an XSLT would need to be written for each JSP page and corresponding client device. There are advantages and disadvantages to using this architecture in terms of development costs, maintenance costs, performance and so on. However, this paper and the sample application illustrate the architecture as shown in the diagram and does not discuss the XSLT architecture. For more information on the XSLT architecture, refer to XSLT architecture.

m-RMS, the Demo Application

The demo application, m-RMS, included with this article, implements the above end-to-end architecture, all three configurations, and runs in all three modes. It models an m-commerce end-to-end solution using Sun's Java technologies. The application is intended for PDA devices and is a resource management and tracking system that enables you to:

  • Record new projects
  • Search projects
  • Update projects
  • Delete existing projects
  • View available and allocated resources to projects

It communicates wirelessly over HTTP to a wireless portal implemented in J2EE and XML.

The m-RMS application is available for download. After downloading the application, follow the instructions in the README to install, configure, and run m-RMS.

References

These references were used to develop this article

Acknowledgments

The authors would like to acknowledge the contributions from Agnes Jacob, De-Hwei Oshaughnessy, Kumara Rajan, and S. R. Venkatramanan towards the implementation of the m-RMS application.








Reader Feedback
Excellent   Good   Fair   Poor  

If you have other comments or ideas for future technical tips, please type them here:

Comments:
If you would like a reply to your comment, please submit your email address:
Note: We may not respond to all submitted comments.

Have a question about Java programming? Use Java Online Support.



Back To Top