Packaging the MIDlet
After testing the compiled MIDlet, the next step is to package the MIDlet so it may be run on an actual MIDP device.
The Application Packager will open. This tool will help you to build a Jar file, with an associated Jad file, which will define your MIDlet and enable MIDP devices to run it. In addition, Simplicity for Palm OS Platform can create a PRC file which will let your MIDlet run on a Palm OS device.
- The first tab of the Application Packager is the MIDlets tab. All of the compiled MIDlets on the classpath will appear. The ToDo MIDlet will appear first in the list, with its fully qualified name of Tutorial1.ToDo.
- A description for the MIDlet may be entered in the Description field; the default ToDo is fine for this test.
The other MIDlets in the list will not be added to the Jar file by default. This is desirable, because Jar and PRC files should be as small as possible.
- Choose the dependencies tab of the packager. This tab shows all the MIDlets selected for the Jar file and the classes which these MIDlets depend on. Double check that Tutorial1.ToDo is the only MIDlet listed.
- The next tab, Suite Properties, lets the user specify other properties of the MIDlet, including the MIDlet suite name and version. For this test, these properties can be left as is.
- The Resources tab is an area where resources such as images can be added to the Jar file. In this example, no resources need to be added, so do nothing on this page.
- The next tab is the Jar tab. The settings on this page should be left as they are.
- The final tab is the PRC tab. You may choose to build a PRC which will run on Tungsten devices, or a PRC which will run on devices running Palm OS 3.5 or 4.0. Press the Build button at the bottom of the window to build the Jar and PRC.
First the Application builder will preverify the classes for the Jar file. This step is required by most J2ME implementations. If the Preverifier cannot be found, an error message will be reported at this point. Simplicity comes with a preverifier from IBM for the Windows Platform. Users on another platform may specify a preverifier in the Program Settings for Simplicity to use.
After preverification, the Application Packager will create the Jar and Jad files. They can be found in the Jar/Zip/JAD Files group of the IDE. They are now ready to be loaded onto a MIDP device.
Next the Application builder will try to build a PRC file. Simplicity uses tools from IBM to create the PRC, and these are currently available for the Windows Platform.
You can test the Jad file by right-clicking it in the IDE and choosing run from the pop-up list. This will open all the MIDlets listed in the Jad in a new MID Emulator. (Only the first on the list will be initially displayed in the Emulator).
You may also load your PRC onto a Palm OS Platform device. If you have set up your program settings correctly (page 56), you can double-click a PRC file from within Simplicity and it will be installed on your Palm OS Platform based handheld computer the next time you synchronize your device. Be sure to load the proper version of IBM's WME JVM for your device (page 52). You may then run your application like any other application on the Palm OS.
Congratulations! You have completed this tutorial and learned many of the basics of working with Simplicity for Palm OS Platform.
| Data Representations, Inc. http://www.datarepresentations.com support@datarepresentations.com sales@datarepresentations.com |