TOC PREV NEXT INDEX



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.

  1. Right-click on the ToDo.class file. Choose 'Build Jar' from the pop-up menu.

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.

  1. 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.
  2. 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 files should be as small as possible.

  1. 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.
  2. 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.
  3. 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.
  4. The final tab is the build tab. The settings on this page should be left as they are. Press the Build Jar File button to build the Jar.

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 for Mobile Devices 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.

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

Congratulations! You have completed this tutorial and learned many of the basics of working with Simplicity for Mobile Devices.


Data Representations, Inc.
http://www.datarepresentations.com
support@datarepresentations.com
sales@datarepresentations.com
TOC PREV NEXT INDEX