Developing applications for Palm

This topic explains how to set up the Palm device and WebSphere Studio Device Developer (WSDD) to work together.

Palm: What you need to get started

The following are prerequisites required for writing and testing applications for the Palm:
  • A Palm device or Palm Emulator (you can download POSE from http://www.palmos.com/dev/tools/emulator/)
  • A copy of a J2ME virtual machine installed on the Palm, for example the Sun's K Virtual Machine (KVM) and IBM's J9, available from http://java.sun.com and http://www.embedded.oti.com
  • A cradle to synchronize the palm with your PC
  • Something to generate .prc files, that is Palm executables, to run on the Palm, such as Sun's J2ME Wireless Toolkit (available at http://java.sun.com) and IBM's WSDD, available at http://www.embedded.oti.com, which includes J9 as standard
  • MQe JARs/classes
This documentation concentrates on J9 and WSDD.

Palm: Getting started with WSDD

You must complete several tasks before using the Palm device or Palm emulator to run MQe MIDlets:
  1. Install the virtual machine onto the unit. The .prc files required for this are located in the C:\IBM\wsdd\wsdd4.0\ive\runtimes\palmos\68k\ive\bin directory or the equivalent location for your installation. You need the following files:
    • j9_vm_bundle.prc
    • j9pref.prc
    • midp15.prc
    • j9_dbg_bundle.prc (only if you are planning to debug an application)
  2. Once you have installed these files on your palm device (it should come with instructions on how to do this), use WSDD to create a new MIDlet suite (in the Java perspective - [File][New][Other][J2ME for J9][Create MIDlet Suite]).
  3. Import the source for the example application into the src directory. Include the MQe library in the list of libraries to use, that is right-click the name of the project in the packages window and select [Properties] [Java Build Path] and the Libraries tab. Use the 'Add External JARs' option to add the MQe MIDP jar to the list. Note the following files are not meant for use under MIDP:
    • mqeexampleapp.msgpump.NormalClient
    • mqeexampleapp.msgpump.NormalServer
    • mqeexampleapp.msgpump.InputThread
    • mqeexampleapp.textapp.Client
    • mqeexampleapp.textapp.GatewayServer
    • mqeexampleapp.textapp.RegistrationServer
    These should be run in Foundation or J2SE to act as command-line implementations of the clients and servers. There are no MIDP servers as it is not an environment that servers are designed to run in.
  4. Set WSDD to run files on that device. With normal Palms, an installation program is provided to enable the installation of new programs from a desktop computer (e.g. C:\Palm\Instapp.exe). This needs to be set in WSDD in [Window][Preferences][Device Developer][PalmOS Java Configuration] under PalmOS Install Tool. You also meed to set the other options in this menu:
    PalmOS Emulator
    This is required if you want to use POSE or a similar PalmOS emulator
    PilRC resource compiler
    This creates the PRC files from the jad and jar. The WSDD help describes the java options in more detail.

Palm: Building for the Palm in WSDD

Once WSDD has been set up to work with the palm, try building and running the example application on your palm device:
  1. Double-click the wsddbuild.xml file from within your project. If you created a J2ME for J9 project and not a normal Java one, it will appear after all the packages.
  2. Select the builds tab from the bottom of the window. Currently, your list of builds should be empty. This window specifies the platforms you are building the project for, that is Palm, PocketPC, Windows, and so on.
  3. Click Add Build and select the palm option from the pulldown platforms menu.
  4. Click Next and enter any creator ID and a name for the application.
  5. Click Next again until you reach the final select launcher screen. If you are using a palm device, select the manual option. If you are using the emulator, select the emulator option.
  6. Click Finish and select the launch tab. Your device should now be a launch option.

Parent topic: Using WebSphere Studio Device Developer (WSDD)