| C H A P T E R 1 |
|
Software Overview |
Java Wireless Client software is a high-performance Java ME platform stack for mobile devices. Java Wireless Client software shortens the porting and integration effort with the following features:
Java Wireless Client software supports many components of Mobile Service Architecture (MSA) (JSR 248). MSA is a comprehensive platform based on CLDC and MIDP. Here is a complete list of the APIs encompassed by Java Wireless Client software:
In addition, Java Wireless Client software also supports JSR 239 OpenGL ES, an optional API that is not part of MSA.
Consult the Java Community Process
(JCP
) program web site, http://jcp.org/, for more information on any of these specifications.
In very broad terms, the architecture of Java Wireless Client software looks like this:
FIGURE 1-1 Overall Architecture
Java Wireless Client software is everything that lies between the OS and applications. The choppy line indicates the portion that must be ported to a new platform. The components are as follows:
layer distills the platform requirements of the entire platform down to a single set of functions that must be ported. All porting is done at the same layer, and the functions are consistently named and well documented.
You don't have to do any porting on PCSL, CLDC, MIDP, and the optional APIs, because they are internally ported to the JavaCall API already. To port to a new platform, all you have to do is the implement the JavaCall API functions to perform the actual work in the underlying OS.
For new development, the JavaCall API is recommended because it simplifies the porting process. However, it is also possible to build Java Wireless Client software without the JavaCall API. In this case, parts of PCSL, CLDC, MIDP, and each optional API must be ported separately.
FIGURE 1-2 Overall Architecture Without the JavaCall API
This book describes how to port Java Wireless Client software to a new device, both with the JavaCall API and without.
The MIDP component is composed of a modular set of services and subsystems. Services provide functionality that all subsystems use, such as logging. Subsystems are high-level functional blocks, such as the user interface and networking.
The following table lists the Java Wireless Client software services.
|
Provides a way to collect information that developers can use during a porting effort or at a later stage of product development. |
|
|
Provides a basic set of memory management routines, such as allocating and freeing memory, that all other subsystems use. |
|
|
Collects and dispatches system events such as user interaction, networking, push events, I/O, and so on. |
|
|
Determines trust in (and permissions for) MIDlet suites and protects APIs. |
|
|
Maintains constants and properties so that they have the same definition in both the Java platform layer (Java layer) and the native platform layer. Also compiles in property values to avoid initialization overhead. See Chapter 5 for more information. |
The following table lists the Java Wireless Client Software subsystems.
Java Wireless Client software subsystems and services are made up of one or more components called libraries. A library is a unit with an explicitly declared exported interface. One or more implementations of the interface can exist. Each implementation declares dependencies on other libraries whose interfaces it imports. A library can be implemented partially in the Java programming language and partially in native code.
No code is shared between alternative implementations of the same exported interface. Shared code resides in a separate library, ensuring that the interface between the shared and non-shared portion is explicitly declared. This separation makes it easy to reuse shared code in new implementations.
Platform-independent code and platform-specific code are contained in separate libraries. The interface between the platform-independent and platform-dependent libraries constitutes the porting interface as shown in FIGURE 1-3.
FIGURE 1-3 Component Implementation
Each library can have multiple implementations, each tailored to a different type of device. This architecture makes Java Wireless Client software easier to port and makes it easier to optimize performance. FIGURE 1-4 describes this architecture.
FIGURE 1-4 Modular Architecture Supporting Multiple Implementations
When you port the Java Wireless Client software, you choose the set of libraries most suited to your system. For each library, you can either choose one of existing implementations or provide your own implementation of the library's exported interface. Because libraries are bound at compile time, this approach has no impact on runtime performance. The build system sets aside unused libraries and implementations so the system's footprint on the device is not increased.
The following diagram illustrates the relationship between the different Java Wireless Client software components. It highlights how control flows between the different components.
FIGURE 1-5 Component Relationships and Flow Control
This section describes how Java Wireless Client software fits into the platform environment. It provides a general idea of what the porting points (areas of interaction between Java Wireless Client software and the device) are. The porting points are made possible by the APIs shown in FIGURE 1-3 and FIGURE 1-6.
FIGURE 1-6 Possible APIs in Subsystems and Services
FIGURE 1-7 shows a number of porting points. For example, one porting point binds Java Wireless Client software low-level graphics primitives with the graphics library of your device. Another porting point manages applications, such as Java Wireless Client software, using native code to provide Over-the-Air (OTA) provisioning required by the MIDP 2.0 Specification.
Copyright © 2007, Sun Microsystems, Inc. All rights reserved. SUN PROPRIETARY/CONFIDENTIAL.