• MakePalmApp

  • The Java class file "palm.database.MakePalmApp" converts a Java application written for the Palm into a file that can be directly downloaded onto the Palm. The MakePalmApp tool represents the last step for building sample applications from Java source to produce a Palm application. Refer to PalmReleaseNotes.pdf for instructions on how to accomplish the first two steps (Compilation and Verification). The Java class palm.database.MakePalmApp represents the main class for this tool and converts a Java application written for the Palm into a 'prc' file that can be directly downloaded onto the device.

    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., JDK1.2.x and JDK1.3.x. This program has not 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 DragonApp
    will 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.

    What it does

    This program converts your Java application into a resource application file that can be downloaded onto the Palm. This application file contains the classes necessary to run your program and the code needed to start the KJava Virtual machine.

    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.

    Options

    The complete list of options is given below. If two options are given on the same line, they are synonyms.
      Each of these options is described in more detail below.

    -v, -verbose

    These arguments cause the program to produce more verbose output. Their effect is cumulative. The option -v -v produces even more output than just a single one.

    -classpath

    If this argument is not specified, the program expects that it can find all of your application's classes starting in the current directory. Thus, for example, the class ShootEmUp.Board will be in the file ./ShootEmUp/Board.class.

    Note that the kjava 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 on 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.

    -icon, -smallicon, -listicon

    Each of these takes as its argument a filename containing a bitmap. The following formats are understood: The application builder uses the extension of the filename to determine the type of bitmap that the file contains.

    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 omitted, your file will be given default icons.

    -JARtoPRC <JAR file>

    The -JARtoPRC argument specifies the <JAR file> containing the application class files that are to be read from the JAR file and converted to a Palm PRC file that can be directly downloaded onto the Palm. The JAR file specified must be in a valid JAR (Java archive) format. The default JAR file is to take the main class name without packages, and append ".jar" to it. So, the default JAR file for the Dragon app would be Dragon.jar.

    -name, -longname

    The -name argument specifies the name that appears under the icon in the launcher. If this name is more than seven or eight characters long, it may be truncated by the Launcher.

    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".

    -output, -o

    This argument specifies the name of the file to which the output is written. This file can then be downloaded onto the Pilot.

    The default output file is to take the main class name without packages, 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.

    -creator

    Every Palm application is required to have a unique Creator ID. Palm recommends that you register your unique Creator ID for each application at its Web site.

    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 extremely 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.
     

    -usagename

    The default value of this argument is "java palm.database.MakePalmApp".

    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.

    -version <string>

    A string indicating the "version" of this application.

    -help

    Print out a help message.

    Multiple class name arguments

    Under most circumstances, this program can determine all the additional classes needed by your application.

    However, if your program makes use of the Class.forName, there may be classes loaded dynamically that the application builder might not 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 it might already be in the KJava Virtual Machine.
     
     

  • ConvPRCtoJAR

  • The Java class file "palm.database.ConvPRCtoJAR" converts a Palm application .PRC file into a Java application in JAR (Java archive) format. The JAR file contains all the Java application classes.

    This documentation does not describe 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., JDK1.2.x and JDK1.3.x. This program has not 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 DragonApp
    will 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.

    What it does

    This program converts your Palm resource application file into a Java application in JAR (Java archive) format. This JAR application file contains the classes necessary to run your program and the code needed to start the KJava Virtual machine.

    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.

    Options

    The complete list of options is given below. If two options are given on the same line, they are synonyms.
     
      Each of these options, along with their default value(s) are given in the description below.

    -v, -verbose

    These arguments cause the program to produce more verbose output. Their effect is cumulative. The option -v -v produces even more output than just a single one.

    -classpath

    If this argument is not specified, the program expects that it can find all of your application's classes starting in the current directory. Thus, for example, the class ShootEmUp.Board will be in the file ./ShootEmUp/Board.class.

    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 on 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.

    -PRCfile <PRC file>

    The -PRCfile argument specifies the Palm application <PRC file> is to be converted to a Java application file in JAR (Java archive) format. The .PRC file specified must be a valid Palm .PRC application file. If no "-outfile <JAR file> is specified for the name of the JAR file to create on local disk, the default JAR file is to use the main class name without packages, and append ".jar" to it.

    -output, -o

    This argument specifies the name of the JAR file to which the JAR file output is written. This file will be generated in JAR (Java archive) format.

    The default output file is to use the main class name without packages, and append ".jar" to it. So ShootEmUp.myGame would be written to myGame.jar.

    -usagename

    The default value of this argument is "java palm.database.ConvPRCtoJAR".

    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.

    -help

    Print out a help message.