Jump is a program that allows developers to write JavaTM code for the Pilot handheld PDA from USRobotics. This has nothing to do with the Internet, HTTP, or the World Wide Web, and in particular will not allow you to run or write Java "applets". It does allow you to use a well-designed, easy to learn language to write applications for the Pilot.
Jump works by reading the .class files produced by a Java compiler, creating 68000 assembly language .asm files as output. The .asm files are then assembled by Pila (the Pilot Assembler) to produce a .prc file which can be loaded directly into the Pilot. Jump is essentially the "back end" of a compiler (a Java source-to-bytecode compiler is the "front end").
The .prc files created by Jump are self contained and do not require any Java runtime support to be present on the Pilot.
There are no features yet. :)
The Jump package includes the following files:
File | Description |
---|---|
Readme.txt | Last minute notes and revision history. Be sure to read this file! |
Jump.exe | Main Jump program as a Win32 executable. |
Jump.zip | Jump class files for use on non-Win32 platforms. |
Jump.htm | Jump documentation (this file). |
palmos.zip | palmos package class and source files. |
native-java.asm | Native 68K implementations of various java.lang methods. |
native-palmos.asm | Native 68K stubs for most of the PalmOS API functions. |
native-*.asm | Other native 68K method implementations. |
Jump.properties | Sample Jump configuration file. |
DecHex\* | Sample program files. |
Hello\* | Sample program files. |
Life\* | Sample program files. |
Jump requires the following software:
In the ASDK, you will also find lots of tools and information that will be indispensable for developing Pilot applications.
NOTE: Do not use PKUNZIP! Use WinZip or another 32-bit unzip program. PKUNZIP, being a DOS program, does not handle long file names and will really screw this up.
set classpath=c:\jumpSee your Java tools documentation if you need more information about the CLASSPATH variable.
Once the files are properly installed, you should run through compiling one of the sample programs to make sure everything works.
javac Hello.java
pilrc Hello.rcp
Jump Hello
The following major Java language features are not yet implemented by Jump:
There are also some other features not yet implemented:
Function | Reason |
---|---|
DmFindSortPosition | no callback functions |
DmInsertionSort | no callback functions |
DmQuickSort | no callback functions |
ErrThrow | use Java throw instead |
EvtGetPenBtnList | returns pointer to array |
FindDrawHeader | FindParamsPtr |
FindGetLineBounds | FindParamsPtr |
FindSaveMatch | FindParamsPtr |
FplXxx | PalmOS floating point library |
FrmSetEventHandler | no callback functions |
GetCharAttr | returns pointer to array |
GetCharCaselessValue | returns pointer to array |
GetCharSortValue | returns pointer to array |
GrfMatch | |
GrfMatchGlyph | |
LstSetDrawFunction | no callback functions |
LstSetListChoices | array of char pointers |
PsrXxx | no callback functions |
SlkSendPacket | arrays of structures |
SlkSetSocketListener | no callback functions |
StrCat | modifies string data |
StrChr | returns address |
StrCopy | modifies string data |
StrItoA | modifies string data |
StrItoH | modifies string data |
StrStr | returns address |
StrToLower | modifies string data |
SysInsertionSort | no callback functions |
SysQSort | no callback functions |
TblSetCustomDrawProcedure | no callback functions |
TblSetLoadDataProcedure | no callback functions |
TblSetSaveDataProcedure | no callback functions |
WinGetPattern | CustomPatternType |
WinGetWindowPointer | returns pointer to structure |
WinSetPattern | CustomPatternType |
Some of the PalmOS API functions require the address of a callback routine to be passed to the API function. Examples of these functions are the sorting functions, FrmSetEventHandler, custom list and table draw functions, SlkSetSocketListener, and some others. These functions are not supported by the current version of Jump.
The only requirement that Jump makes of your source code is that you have a function PilotMain in your main class declared like this:
public static int PilotMain(int cmd, int cmdPBP, int launchFlags)
This is the function that is called when your application starts. For a normal application launch, cmd will be 0. This function should normally return 0.
Resources are expected to be found in a file called classname.res where classname is the name of the main class passed to Jump. This file is copied verbatim into the classname.asm file.
To create a .prc file from a .class file, run the Jump.exe program with the name of your main class (the one containing the PilotMain method) on the command line. For example,
Jump Hello
Assuming all goes well, Jump will create a Hello.asm file and automatically run Pila to create a Hello.prc file.
Jump accepts options anywhere on the command line. The following options are recognized:
Option | Description |
---|---|
-c | Compile .class file from .java file using javac if necessary. |
-d | Delete .asm file after running Pila. |
-l | Passed on to Pila to generate an assembly listing file. |
-o | Enable the peephole optimizer. |
-s | Include Copilot compatible symbols in the output file. |
-v | Verbose progress and status output. |
You may also create a file called Jump.properties in the current directory. This text file contains lines of the form "name=value". Valid property names are shown in the following table:
Property | Default | Description |
---|---|---|
javac | javac | Name of command line Java compiler. Use jvc for MS Java SDK. |
options | Option flags (above) as they would be specified on the command line. | |
pila | pila | Name of Pila assembler. May include a pathname if pila is not in your path. |
Here is an example of a Jump.properties file (the double backslashes are not a typo, they are required wherever you would normally use a single backslash):
2.3 Program-specific Optionsjavac=jvc options=-c -o pila=e:\\asdk\\bin\\pila
There are two program-specific options that Jump recognizes. These are specified in a file called classname.jump in the current directory. The valid options are:
Option | Default | Description |
---|---|---|
appid | test | Four-letter PalmOS application ID. |
appname | classname | Name of application as it will appear in the Pilot applications list. |
Here is an example of a classname.jump file:
appname=Hello World appid=Helo
Jump supports the Java native keyword for calling methods implemented in 68K assembly language. This is used by Jump to implement various native parts of the java.lang package, and also to implement the PalmOS API function stubs. The implementations of native methods are loaded from files that begin with "native-" and end with ".asm". There can be as many of these files as you like; they are all searched for native methods.
To create your own native methods, declare a method in a class as native. This indicates to the Java compiler and Jump that the implementation of the method is not in Java, but is an external method. Create a native-*.asm file to hold the implementation of the method, and write the assembler code for the method in this file.
You may put more than one native method implementation in a native .asm file. Each method implementation must be separated by at least one blank line, and method implementations cannot contain any blank lines.
Here is a simple example of a native method declaration and implementation:
NativeTest.javaclass NativeTest { public native static int Add(int x, int y); }native-test.asm
NativeTest__Add: link a6,#0 move.l 8(a6),d0 add.l 12(a6),d0 unlk a6 rts
Note that arguments to Java methods are pushed from left to right. This is different from the way arguments are passed to PalmOS API functions.
Here is a list of features that I would like to put into Jump. If you have any features you would like to see in Jump, please let me know!
Darrin Massena (Pilot Software Development) for Pila, the Pilot Assembler. Darrin is also leading the effort to put together the Alternative SDK, a suite of tools for Pilot development that is independent of the Macintosh.