The Palm application will appear in your launcher just like any other Palm application. Touching the application icon will cause it to begin running.
This documentation does not discuss how to set up the appropriate environment variables. It is assumed that the value of the environment variable CLASSPATH includes the zip file that contains the classes in the "palm.database" package.
This code has been tested in all versions of JDK1.1.x. and JDk1.2.x. This program has not yet been tested with any JDK1.0.x version of Java.
At its simplest, you execute the program as follows:
java palm.database.MakePalmApp [<options> . . .] class [class ....]For example,
java palm.database.MakePalmApp DragonAppwill generate a file DragonApp.prc that can be downloaded onto the Palm.
The class name given (DragonApp in the above argument must contain a
public static void main(String argv[])method, and it is this method that is called automatically when you launch the application.
There are numerous options that can precede the class name. You may also include more than one class name, though in most cases this isn't necessary. If you include multiple classes, the first class name specified must be the class with the main method.
After you download the application file, your application will appear in the launcher, along with all the other Palm applications. Touching the application icon starts the Java Virtual Machine.
The converter tries to find all non-core classes used by your program, and includes them into the resource file. It automatically includes all non-core classes specified in your application, as well as all the non-core classes that they reference.
Note that the KJava core classes (see the -skiplist option) do not need to be accessible via the classpath. They are recognized as being core classes by their name and are not looked at.
You should give a classpath argument if you are running the application builder from a directory other than the directory in which the class files for your application reside.
The classpath argument is a list of directories and zip files. The components of the list are separated by a colon a Unix machines, and by a semicolon on Windows machines. Each directory or zip file is searched, in turn, for a specific class file.
Note that the CLASSPATH environment variable, or any -classpath argument passed directly to Java are ignored. Your application should not be accessing the same class files that "big java" is running.
The -icon argument indicates the file contains the bitmap that should appear in the Palm Launcher's "icon view". The PalmOS expects this icon to be 32x32 bitmap, in which the five left-most and right-most columns are white, and in which the bottom most ten rows are white. If you pass a file containing a bitmap of a different size (most common is 22x22), the bitmap will be converted into a 32x32 bitmap by top-adjusting it and centering it horizontally.
The -smallicon argument indicates the bitmap that appears in the Launcher's "list view." The PalmOS expects a 15x9 bitmap. If you pass a file containing a different sized bitmap, it is converted into a 15x9 bitmap by top-adjusting it and centering it horizontally.
If either argument is omited, your file will be given default icons.
The -longname argument specifies the "true" name of the application. This name appears when you go to the launcher's Beam and Delete menus. This name can be at most 31 characters.
If you do not specify a -name argument, then the class name, without packages is used. If you do not specify a -longname argument, then the full class name is used.
For example, if your main class is ShootEmUp.myGame, the default name is "myGame" and the default long name is ShootEmUp.myGame".
The default output file is to take the packageless main class name, and append ".prc" to it. So ShootEmUp.myGame would be written to myGame.prc
Note that the PalmOS does not care what the name of the file is. The correspondence between the name of the ..prc file and the name of the class is purely a convenience.
For Java One, this is clearly infeasible. The application builder will automatically generate a creator ID for you that is based on the name of the main class of your application. The creator ID is constructed in such a way that it is extremly unlikely that your creator ID will conflict with another application.
If you plan to use databases with your Java application, or plan to do other serious long term work, you should register a 4-letter ID with Palm, and then pass that 4-letter id as the argument to this function.
When you specify -verbose -verbose, the application builder
prints out the creator ID that has been assigned to your application.
The first line of the help message, printed out when the user gives the -help argument or makes some other mistake, begins with the value of this variable.
If you create a batch file or shell script, you can add
-usagename <name of batch file>so that the error message will reflect the name of your batch file.
However, if your program makes use of the Class.forName, there may be classes loaded dynamically that the application builder cannot know about. You must explicitly specify these classes.
If you specify a system class as an additional class name, it will be
included as part of your application, even though they already in the KJava
Virtual Machine. I can't imagine why you'd want to do this, but you can.
This documentation does not discuss how to set up the appropriate environment variables. It is assumed that the value of the environment variable CLASSPATH includes the zip file that contains the classes in the "palm.database" package.
This code has been tested in all versions of JDK1.1.x. and JDk1.2.x. This program has not yet been tested with any JDK1.0.x version of Java.
At its simplest, you execute the program as follows:
java palm.database.ConvPRCtoJAR [<options> . . .] class [class ....]For example,
java palm.database.ConvPRCtoJAR DragonAppwill convert the Palm application DragonApp.prc file into a file DragonApp.jar that will contain all the Java application classes.
The class name given (DragonApp in the above argument must contain a
public static void main(String argv[])method, and it is this method that is called automatically when you launch the application.
There are numerous options that can precede the class name.
The converter tries to retrieve all Palm class resources from the Palm .PRC file and a JAR file entry is created for each of the classes and written out to the JAR file along with its respective class data. For each of the Java classes, a manifest entry is also generated. All the manifest entries are dumped into the manifest file, META-INF/MANIFEST.MF, which is also created as part of the JAR file.
See "The Java Class Libraries Second Edition, Volume 1 Supplement for the java 2 Platform Standard Edition, v1.2" for further information on JAR Manifest files.
You should give a classpath argument if you are running the application builder from a directory other than the directory in which the class files for your application reside.
The classpath argument is a list of directories and zip files. The components of the list are separated by a colon a Unix machines, and by a semicolon on Windows machines. Each directory or zip file is searched, in turn, for a specific class file.
Note that the CLASSPATH environment variable, or any -classpath argument passed directly to Java are ignored. Your application should not be accessing the same class files that "big java" is running.
The default output file is to take the packageless main class name, and append ".jar" to it. So ShootEmUp.myGame would be written to myGame.jar.
The first line of the help message, printed out when the user gives the -help argument or makes some other mistake, begins with the value of this variable.
If you create a batch file or shell script, you can add
-usagename <name of batch file>so that the error message will reflect the name of your batch file.