Every MIDlet suite file is accompanied by a Java Application Descriptor ( ) file. This file contains a predefined set of attributes that allow the application management software () to identify, retrieve, and install the MIDlets. The JAD file enables the application management software on a mobile device to verify that the MIDlet is suited to the device before loading the full JAR file of the MIDlet suite. The descriptor also supplies configuration-specific attributes (parameters) to the MIDlet or MIDlets without modifying the JAR file.
In the IDE, the JAD file is created automatically when you create
a MIDlet suite. The contents of the application descriptor file can be viewed
and edited by choosing File "Project
name" Properties, then selecting Application Descriptor.
The following attributes are required in a JAD file:
MIDlet-Name
. The name of the MIDlet suite that identifies
the MIDlets to the user.MIDlet-Version.
The version number of the MIDlet suite. The
application management software uses the version number for install actions
and upgrades, as well as communication with the user. MIDlet-Vendor.
The organization that provides the MIDlet
suite.Other attributes are available for use, depending on the version of MIDP supported by the project configuration:
MIDlet-JAR-URL
. Location and name of the JAR file for this
MIDlet suite.MIDlet-JAR-Size.
The size of the JAR file built from this
MIDlet suite. This read-only property is updated each time the JAR file is
built.MicroEdition-Profile.
The Java ME profile required, using the
same format and value as the system property microedition.profiles (for
example, MIDP-1.0).MicroEdition-Configuration.
The Java ME configuration
required, using the same format and value as the System property microedition.configuration (for
example, CLDC-1.0).MIDlet-Description.
The description of the MIDlet suite.MIDlet-Icon.
The name of a PNG file within the JAR file and
used to represent the MIDlet suite. The application management software
displays this icon to identify the suite. MIDlet-Info-URL.
A URL for information further describing
the MIDlet suite. MIDlet-Data-Size.
The minimum number of bytes of persistent
data required by the MIDlet. The device might provide additional storage
according to its own policy. User-defined attributes in the JAD file can provide the AMS with additional information about a MIDlet that, for example, might help the AMS determine whether the application can be run on the target device.
Another use for user-defined attributes is that they can help a MIDlet dynamically adapt itself to different target devices. As a result, the same JAR file can support a variety of devices without being modified.
For example, you might add the attributes Display-Width = 160
and Display-Height
= 120
to the JAD, which defines the display area of the target device.
Each user-defined attribute must have a unique name. Attribute names cannot
start with MIDlet-
, and cannot contain spaces.