Java programming for the Palm OS using Jump
If you're a Java programmer itching to code for a new platform, Jump is for you. Now you can write Java applications for the ubiquitous Palm OS.
What is Jump?Jump is a Java-to-assembly compiler. Jump converts Java class files into 68000 assembly language, producing .asm files. These files are then converted into Pilot-friendly files with Pila (a Pilot assembler) to produce a .prc file that can be loaded into your Palm device. Once compiled into a .prc file, your application will not need a Java Virtual Machine (JVM) in order to run on the Palm OS. And since the Java code is converted to assembly, your programs will be lightning fast.
InstallationBecause Jump's documentation can be confusing, what follows is a detailed, step-by-step breakdown of how to get Jump running on your PC. First, you need to gather the proper materials: Sun's JDK 1.1, Pila, and Jump itself.
Configure JDK1.1If you don't have JDK1.1, download and install it. Make sure to set your PATH and CLASSPATH by opening the file called autoexec.bat in a text editor like Notepad. (Autoexec.bat is in your C drive at root level.) You'll find a line that reads something like:
Add a semicolon and then the path to your BIN directory of JDK -- this path should contain no spaces. For example, the new path statement could read:
After that is done, on a new line, add the CLASS PATH to your JDK directory. For example:
Next, you have to unzip the classes.zip into the same directory where classes.zip resides (e.g., C:\JDK1.1.4\lib). Currently, Jump doesn't know how to look in zipped files. For this operation use a 32-bit unzip program like WinZip (not PKUNZIP).
Install the Palm Compiler, PilaPila is part of the Alternative Software Development Kit (ASDK) -- a resource that contains many good tools to help a Palm OS software developer. Pila takes assembly files (.asm) and compiles them to Palm executable files (.prc). PRC files can then be installed to your Palm device using the Palm Desktop.
Download the ASDK, including Pila. The "readme" file contains installation information. Just remember to add the ASDK bin directory to your PATH, because Jump needs to run Pila.
Note: You don't need to get your ROM from your PalmPilot (which would be illegal). The people at 3Com provide one free for developers. Download the Palm OS ROM and place it in the BIN directory of ASDK. You can also download a Palm OS emulator, so you don't have to test your buggy applications on your Palm device. After restarting your computer, you can make sure everything's properly installed by typing in
Install JumpYou're almost there. The only thing left is to download and install Jump and write a "Hello World" application.
Download Jump and its accompanying notes. Unzip Jump, using a 32-bit unzip program, into a directory called "Jump." Unzip palmos.zip into that directory as well, so that the files are in C:/Jump/palmos. Unzip Jump.zip into the C:/Jump directory. Add Jump to your PATH and your CLASSPATH. Restart your computer and test by going to a DOS prompt and typing in:
You should see copyright info, usage, and options. If Jump fails to start, check Jump's documentation. (If you have problems, make sure you have the latest Microsoft JVM installed.)
Coding "Hello World"You're now ready to start coding. When you program for the Palm OS using Jump, you need to go through a three-step process: write Java code and use the JDK to create .class files; run Jump to convert to assembly, which automatically runs Pila to create .prc files; load the .prc file into the Palm device.
The "Hello World" example that comes with Jump relies on assembly language, but this undermines the beauty of the Java-to-PRC concept. Therefore, I have written an application entirely in Java to enable you to extend your programming prowess to this latest platform.
Using your favorite Java IDE, type the following code:
Save the file as Hi.java in the Hello directory in the Jump folder.
Go to a DOS prompt and go to the C:/Jump/Hello directory. Type in the DOS window:
Next, at the DOS prompt type:
This should create Hi.asm and Hi.prc in the C:/Jump/Hello directory. If there is no .prc file, your PATH is probably not set properly for Pila (see above).
From here, you can use your Palm Desktop to add the Hi.prc file to your Palm device. Don't forget to back up all of your Palm's data onto your PC.
Launch the program by tapping on "Hi" in the applications listing. The program will quit when you tap on the screen. Cool, huh?
TroubleshootingWarning: Don't forget that your programs are not running within the protective sandbox of a JVM. You always need to code a way to exit your application. Before adding a new application to your Palm device, always HotSync.
If you've installed a runaway application on your machine, try the following. Unscrew the top of your Palm stylus and use the secret tool to push through the secret hole on the back of your Palm device -- this will cause you to loose all of your data. Don't say I didn't tell you to HotSync.
ConclusionCheck the documentation for a list of not yet implemented features. To write more-exciting programs than "Hello World," become familiar with the palmos package that is provided with Jump. There's scant documentation, but the methods and data members are pretty self-explanatory so you shouldn't have any problem figuring out what they do.
In no time, you should be writing applications for the Palm OS that will wow friends and win over enemies.
Java is a trademark of Sun Microsystems, Inc.