Java Reference
In-Depth Information
MIDlet-1: Jargoneer, , Jargoneer
MIDlet-Name: Jargoneer
MIDlet-Vendor: Jonathan Knudsen
MIDlet-Version: 1.0
MicroEdition-Configuration: CLDC-1.0
MicroEdition-Profile: MIDP-2.0
Now assemble the MIDlet classes and the extra manifest information into a JAR with the
following command:
jar cvmf extra.mf Jargoneer.jar Jargoneer.class
With the J2ME Wireless Toolkit, the toolkit automatically assembles your application into
a MIDlet suite JAR when you click the Build button. It's very convenient, and it saves you from
the effort of learning the jar tool.
Creating a MIDlet Descriptor
One additional file is needed before your MIDlet is ready to go out the door. An application
descriptor file must be created. This file contains a lot of the same information that's in the
MIDlet JAR manifest file. However, it lives outside the JAR and enables application management
software to learn about a MIDlet JAR without installing it.
The application descriptor is a text file with a .jad extension. Type in the following and
save it as Jargoneer.jad :
MIDlet-1: Jargoneer, , Jargoneer
MIDlet-Jar-Size: 2347
MIDlet-Jar-URL: Jargoneer.jar
MIDlet-Name: Jargoneer
MIDlet-Vendor: Jonathan Knudsen
MIDlet-Version: 1.0
MicroEdition-Configuration: CLDC-1.0
MicroEdition-Profile: MIDP-2.0
If your MIDlet suite JAR is a different size, enter the actual size for the MIDlet-Jar-Size
entry. The MIDlet descriptor is automatically generated when you click the Build button in the
J2ME Wireless Toolkit. If you're using the J2ME Wireless Toolkit, you won't need to create the
application descriptor yourself.
Using an Obfuscator
Because MIDP devices have so little memory, MIDlet suites should be as compact as possible.
An obfuscator is a useful tool for minimizing the size of MIDlet suite JARs. Obfuscators, originally
designed to foil attempts to reverse engineer compiled bytecode, perform any combination of
the following functions:
Renaming classes, member variables, and methods to more compact names
Removing unused classes, methods, and member variables
Inserting illegal or questionable data to confuse decompilers
Search WWH ::




Custom Search