Enterprise J2ME Developing Mobile Java Applications [Electronic resources] نسخه متنی

اینجــــا یک کتابخانه دیجیتالی است

با بیش از 100000 منبع الکترونیکی رایگان به زبان فارسی ، عربی و انگلیسی

Enterprise J2ME Developing Mobile Java Applications [Electronic resources] - نسخه متنی

Michael Juntao Yuan

| نمايش فراداده ، افزودن یک نقد و بررسی
افزودن به کتابخانه شخصی
ارسال به دوستان
جستجو در متن کتاب
بیشتر
تنظیمات قلم

فونت

اندازه قلم

+ - پیش فرض

حالت نمایش

روز نیمروز شب
جستجو در لغت نامه
بیشتر
لیست موضوعات
توضیحات
افزودن یادداشت جدید



2.4 Java 2 Micro Edition Explained


Although enterprise mobility solutions can be implemented over J2SE laptops and J2ME devices, the J2ME solutions have significantly lower costs. A Gartner 2002 study concluded that the TCO (Total Cost of Ownership) of smart phones is only one-tenth of wireless laptops and one-fourth of wireless PDAs. The sheer number of J2ME devices makes J2ME the most important enterprise mobility platform. We will focus on J2ME in this book.


2.4.1 J2ME Architecture


Merely distinguishing J2ME from J2SE does not solve all our compatibility problems. There is a huge variety of mobile devices, designed for different purposes and with different features. The "lowest common denominator" does not work. For example, applications on an automobile mounted system are much more complex than those on a cell phone. Even among similar devices, such as high-end and low-end cell phones, portability can cause underutilization of resources on one device and strain on another.

To balance portability with performance and feasibility in the real world, J2ME contains several components known as configurations, profiles, and optional packages (Figure 2.2). Each valid combination of a configuration and a profile targets a specific kind of device. The configurations provide the most basic and generic language functionalities. The profiles sit on top of configurations and support more advanced APIs, such as a graphical user interface (GUI), persistent storage, security, and network connectivity. The optional packages can be bundled with standard profiles to support specific application needs.


Figure 2.2. J2ME components.



2.4.2 J2ME Components


The two most important J2ME configurations are as follows.

The Connected Limited Device Configuration (CLDC) is for the smallest wireless devices with 160 KB or more memory and slow 16/32-bit processors. The CLDC has limited math, string, and I/O functionalities and lacks features such as the JNI (Java Native Interface) and custom class loaders. Only a small subset of J2SE core libraries is supported by the CLDC virtual machines (known as KVMs or Kilobyte Virtual Machines). The most recent version of the CLDC is version 1.1. It was developed by the JSR 139 and released in March 2003.

The connected Device Configuration (CDC) is for more capable wireless devices with at least 2 MB of memory and 32-bit processors. Unlike the CLDC, the CDC supports a fully featured Java 2 VM and therefore can take advantage of most J2SE libraries. The CDC v1.0 was developed by the JSR 36 and it became available in March 2001. The new CDC v1.1 is currently being developed by the JSR 218 and is expected before the end of year 2003.


The most important and successful J2ME profile is the Mobile Information Device Profile (MIDP), based on the CLDC. The MIDP targets the smallest devices, such as cell phones. It is already deployed on millions of handsets. However, the MIDP v1.0 lacks some important features, such as security and advanced UI controls. As a result, device vendors often supply their own MIDP extensions to provide advanced custom features. Vendor-specific extensions undermine the protability of J2ME applications. Many problems with the MIDP v1.0 have been fixed in the MIDP v2.0, which came out of JCP in August 2002. Chapter 8.

Mobile Media API

It supports audio/video controls and streaming media. The v1.0 specification was finalized in June 2002.

Wireless Messaging API

It supports wireless messaging, including SMS messages. The Wireless Messaging API (WMA) v1.0 specification came out of JCP in August 2002. WMA v2.0, currently under development in JSR 205, will include Multimedia Message System (MMS) capabilities. For more details, see Chapter 9.

Location API

It supports location tracking for wireless devices. The v1.0 final release came out in September 2003. For more details, see Chapter 18.

J2ME Web Services API

It supports Web Services-related XML processing. For more details, see Chapter 17.

Bluetooth API

It supports the Bluetooth communication protocol. It is already available.

Security and Trust API

It allows a Java phone to interact with its security smart card. This API should be available in late-2003.

Mobile 3D Graphics API

It supports 3D graphics. This API is still under JCP development.

SIP API for J2ME

It provides support for the Session Initiation Protocol (SIP), which is commonly used in multimedia and VoIP applications. A public review draft of this API was released by the JSR 180 expert group in May 2003. The final specification release is expected before the end of 2003.

Presence and IM APIs

These are J2ME versions of bigger JAIN packages. They are developed by JSRs 164/165 and 186/187. They leverage SIP to provide presence and IM support for mobile devices.

Note

According to the roadmap published by the JSR 185 (Java Technology for the Wireless Industry [JTWI]), the Mobile Media API must be present on JTWI-compliant devices if they expose video/audio capability to Java applications.

Table 2.3. CDC-Based Profiles

Name

Description

Foundation Profile (FP)

It is desingned for devices with reliable network connections. The FP provides a rich Java network environment, including support for multiple communication protocols and security. The FP does not support GUIs. It is used on network devices that do not require direct user interactions. The FP came out of JSR 46 in March 2002.

Personal Basis Profile (PBP)

It adds GUI support on top of the FP. The PBP targets high-end PDAs, such as Compaq iPaq and Sharpe Zaurus, and Internet appliances. PBP's GUI API is a subset of J2SE Abstract Windowing Toolkit (AWT). The PBP became a formal specification in June 2002.

Personal Profile (PP)

It is built on top of the FP and the PBP. It targets the same device category as the PBP. However, PP devices tend to be more powerful (2.5 MB RAM is required for the PP as opposed to 2 MB for the PBP). The PP was released by the JCP in September 2002.

Game Profile

It targets high-end consumer game devices (game consoles). The Game Profile is still under JCP development, but it has not been active since June 2001.

Table 2.4. CDC-Based Optional Package

Name

Description

RMI Optional Package

It includes lightweight RMI APIs to support interoperability with RMI-based J2SE and J2EE applications. This package enables Jini technology for distributed device networks. This package became available in June 2002.

JDBC Optional Package

It provides a subset of JDBC v3.0 APIs to support direct database access from mobile devices. This package was approved by the JCP in December 2002.

Advanced Graphics and UI

This package provides Swing, Java 2D, Image I/O, and the Input Method Framework APIs for more capable mobile devices. It includes new classes defined in J2SE 1.4.1. This optional package is currently being developed under JSR 209.


The JCP at work


When JSR 209 (Advanced Graphics and UI Optional Package for J2ME) was proposed, there were some doubts about the wisdom of supporting the large Swing/Java 2D libraries in J2ME. Some were concerned about the fragmentation of the Swing API, while others argued that if a device is powerful enough to support those APIs, it should probably run J2SE instead of J2ME. But most EC members agree that Swing is a nice-to-have feature if it is completely optional. Then, in JSR 216 to 219, Sun Microsystems proposed to prepare the next-generation (version 1.1) CDC/FP/PP for Swing and Java 2D support, which would result in added baggage for vendors who do not plan to support the optional JSR 209. That caused a major revolt among J2ME EC members. A vast majority of EC members voted against the new JSRs and sent them back for reconsideration, which demonstrates the demorcratic JCP process at work.


/ 204