|
Article Excerpt In September 2002, Sun released the J2ME Personal Profile 1.0. Unlike the MIDP, which is the core technology for Java-enabled wireless phones based on Connected Limited Device Configuration (CLDC), Personal Profile is based on the Connected Device Configuration (CDC). The CDC provides a virtual machine that includes a full Java 2 Virtual Machine feature set. Compared to CLDC, it assumes more memory and higher availability on network connections.
The Personal Profile contains a full set of AWT APIs that support a graphical user interface (GUI), including support for applets and Xlets, and provides a complete application environment for the high-end PDA market. It expands the J2ME territory to include devices that require a full GUI and a high degree of compatibility with the PersonalJava and J2SE application environment.
The Xlet application model, which is inherited from the Personal Basis Profile, is one of its most important features. What is an Xlet? Like an applet in J2SE, it's an application that must be run in an application manager. In other words, it does not have a main() method and cannot be run in standalone mode. However, it implements an interface that the application manager can use to manage its state.
Xlets potentially may play a more important role in J2ME compared to an applet in J2SE. Downloading third-party Xlets provides a way for a PDA to dynamically expand its functionality. One Xlet can even provide services to other Xlets through Inter-Xlet Communication, which makes it easy to develop client/server style applications that consist of multiple Xlets with fine modularity.
In this article, I'll talk about the Xlet life cycle and how to write an Xlet.
Xlet Life Cycle
An Xlet must implement four methods defined in the javax.microedition.xlet.Xlet interface:
public interface Xlet { public void initXlet(XletContext ctx) throws XletStateChangeException; public void startXlet() throws XletStateChangeException; public void pauseXlet(); public void destroyXlet(boolean unconditional) throws XletStateChangeException; }
Xlets, Like applets, have a life cycle. The Xlet application manager uses these four methods to interact with an Xlet to manage its state. It's impractical to talk about Xlet programming without mentioning the Xlet life cycle. So before going into the programming details, let's take some time to understand an Xlet's life cycle.
An Xlet has four states:
* Loaded: The Xlet is loaded from local storage or network and its no argument constructor is called. It can...
|
|

More articles from Java Developer's Journal
Java.net.NetworkInterface: a road warrior's friend. (Network Connectiv..., July 01, 2003 ExtenXLS Java/XLS Toolkit 2.1. (Labs)., July 01, 2003 West Web Services Edge 2003. (International Web Services Conference & ..., July 01, 2003 Fiorano releases FioranoMQ 7.0. (Industry News)., July 01, 2003 Wily Technology integrates Introscope 4.1 with Oracle9iAS. (Industry N..., July 01, 2003
Looking for additional articles?
Search our database of over 3 million articles.
Looking for more in-depth information on this industry?
Search our complete database of Industry & Market reports by text, subject, publication
name or publication date.
About Goliath
Whether you're looking for sales prospects, competitive information, company
analysis or best practices in managing your organization,
Goliath can help you meet your business needs.
Our extensive business information databases empower business
professionals with both the breadth and depth of credible,
authoritative information they need to support their business
goals. Whether it be strategic planning, sales prospecting,
company research or defining management best practices -
Goliath is your leading source for accurate information.
|
|