|
Question How do I write an application for the upcoming J2ME Personal Profile? Tip First as background, the J2ME Personal Profile is a J2ME Connected Device Configuration (CDC)-based technology for small devices. It is the migration path for PersonalJava technology. Personal Profile differs from the better known Mobile Information Device Profile (MIDP), in that Personal Profile is meant for higher end devices, such as high-end PDAs (such as, Sharp Zaurus), smart communicators (such as PDA/cell phone combinations), TV set-top boxes, game consoles, automobile dashboard electronics, and so on. MIDP is currently meant for smaller devices with small LCD screens and limited input entry methods (such as a cell phones with simple keypads). Also, MIDP is currently a J2ME Connected Limited Device Configuration (CLDC)-based technology. It has limited Java technology -- for example, it has no support for floating point, no on-board bytecode verification, no Java Native Interface (JNI), no Abstract Windowing Toolkit (AWT), and no advanced Java 2 technology features (such as reflection and security). By contrast, J2ME Personal Profile is a J2ME CDC-based profile and therefore has all those missing features. Note that J2ME CDC is fully compliant with the Java 2 VM specification. This allows a developer using the Personal Profile to leverage his or her knowledge of the Java 2 Platform, Standard Edition to write programs for smaller devices. More importantly, J2ME Personal Profile has full AWT 1.1 support. This means that you can write your application following the regular J2SE AWT APIs without having to relearn anything (that is, as long as you stay within the AWT 1.1 subset of APIs). Lastly, applications and applets written for J2ME Personal Profile are upwardly compatible with J2SE. In other words, an applet written for J2ME Personal Profile will also run as an applet in a Web browser with J2SE, such as Netscape Navigator or Internet Explorer. This is a good mechanism for interoperability of applets that you want to run in both J2ME Personal Profile and J2SE environments (as long as you remember to conform to the smaller device's screen size). Build your application using the PersonalJava Emulation Environment (PJEE) and the J2SE v1.2 javac compiler. First write the program following the AWT 1.1 APIs and J2SE, v1.2. Here's an example of a program written for the J2ME Personal Profile:
Then, compile the program using the J2SE v1.2 javac compiler and PersonalJava Compatibility Classes 1.2. Finally, run JavaCheck against your program to make sure the APIs you use fall under the PersonalJava subset. This also means that your program will run with the J2ME Personal Profile. To test the program, use PJEE for your specific platform, or download your Java class to a PersonalJava device (such as Sharp Zaurus). If you test on a Sharp Zaurus, do the following:
You should find that writing an application for J2ME Personal Profile is as easy as AWT. Acknowledgments Thank you to member Hinkmond Wong for the solution to this question.
| ||||||||||||||||||||||||||||||
|
| ||||||||||||