Developing for Palm Devices

Note: most Palm devices use Windows Mobile nowadays.

Palm handhelds also support J2ME applications when the IBM WebSphere Everyplace Micro Environment (WEME) has been installed. MIDP applications can be installed normally over the air (OTA) as any other application. If you want to install applications directly via the USB connection or if you want to use the complete screen size, the JAR file has to be converted into the proprietary PRC format.

Preparations

The Palm converter and simulator can be downloaded from https://pdn.palm.com/. When you extract the WEME tools you will find additional libraries in the Tools/lib folder. You need to adjust the CLASSPATH environment variable of your system to include those libraries or you need to copy them to ${java.home}/lib.

In your build.xml script you then need to define the palm.weme.home property that points to the folder into which you have extracted the WEME tools:

<property 
	name="palm.weme.home" 
	location="C:/Program Files/Palm/WEME57" 
/>

Converting JARs into PRCs

J2ME Polish automatically converts JAR files into the Palm PRC format when you target Palm devices. You can fine tune the conversion process by adding following Ant properties or J2ME Polish variables to the build.xml script:

NameDefaultExplanation
palm.vendorId   A 4 character long vendor ID. When no ID is defined, an ID will be created automatically.
palm.smallIcon   URL of the file that contains a small application icon.
palm.largeIcon   URL of the file that contains a large application icon.
palm.splash   URL of the file that contains a splash image.
palm.enableHighRes true Enable the high resolution mode, so that your application can use the complete available screen.
palm.enableDebug false Enables the debug mode of the Palm. In this mode all System.out.println() message are stored on the memory card.
palm.enableInstall false Automatically installs the generated PRC file on the connected Palm handheld.

The following example adds a splash image to the application and defines a vendor ID:

<variable name="palm.largeIcon" value="resources/native/splash.jpg" />
<variable name="palm.vendorId" value="ENSW" />

When you target only a generic device like the Generic/multi one, you can invoke the converter by adding the jar2prc finalizer to the <build> section of your build.xml script:

<finalizer name="jar2prc" />

Starting the Palm Simulator

As with many other vendors you can start the Palm simulator by using the <emulator> section. You need to define the Ant property palm.simulator.home that points to the folder that contains the PalmSim.exe executable:

<property 
	name="palm.simulator.home" 
	location="C:/Program Files/Palm/Simulator" 
/>