he Palm Treo platform has gained wide appeal as a communications device for mobile professionals, enjoying several launches in the enterprise over the last few months. With the wide use of Java in business and the capabilities of these devices (including a large screen and keyboard), it only makes sense to explore using the Palm Treo (or related devices including the LifeDrive) to run legacy and new Java MIDP applications. Fortunately, the IBM WebSphere Everyplace Micro Environment for Palm OS Garnet (WEME) provides a MIDP2.0/CLDC 1.1 compliant run-time with support for file and personal information manager (PIM) integration (via JSR-75) as well as Web services development with JSR-172. This article shows you how to migrate your J2ME applications to Palm OS using the WEME, assuming you have some previous experience with Java MIDP development. If you need an introduction to J2ME, see one of the many other articles on J2ME from DevX (a full list can be found here
Setting Out with the Developer Tools
In order to run J2ME applications, a target device must have a Java runtime consisting of the Java Virtual Machine (JVM) and the libraries that implement the J2ME classes. Java on Palm-powered handhelds is not new: Sun itself released a runtime for Java in the late nineties, which later became the basis for the first J2ME runtime. However, until recently it was difficult to obtain a Java runtime for Palm-powered devices appropriate for end-user application executionmost were fraught with stability, performance, and licensing issues. The IBM WEME changed this, providing a state-of-the-art stable runtime for many Palm-powered devices, including the Treo, LifeDrive, and select Tungsten and Zire devices.
The WEME consists of several components for Palm OS, including:
- The Java MIDP runtime itself.
- Localization overlays for the Java MIDP runtime for languages including Spanish, French, Italian, German, and Japanese.
- An implementation of FileConnect and PIM integration classes specified in JSR-75.
- An implementation of the Web Services API specified in JSR-172.
- A preferences panel for Palm OS that lets users specify the degree of access Java applications have to PIM data, and localization overlays for this preferences panel.
You can get these components from one of two sources. If you're just casually interested in running J2ME applications on your handheldsay, a Verizon Treo 650you can simply install the handheld-required packages here
. Installing these components is easysimply use the Palm Desktop Install Toolbut time-consuming, because there are so many PRCs; if you miss installing a PRC, you won't have the functionality you need to run some Java applications. As with all such things, it's best to read the documentation that accompanies the WEME carefully.
On the other hand, if you're planning on developing J2ME applications and want to test more thoroughly during development, you should obtain these components directly from IBM here. These components are built as Windows DLLs that work in conjunction with the Palm Simulator, letting you test and run your J2ME applications on your desktop workstation.