As a rule, the Manifest in the JAR
must contain:
- MIDlet-Name
- MIDlet-Version
- MIDlet-Vendor
- MIDlet-1
- MicroEdition-Profile
- MicroEdition-Configuration
The JAD
must contain:
- MIDlet-Name
- MIDlet-Version
- MIDlet-Vendor
- MIDlet-Jar-URL
- MIDlet-Jar-Size
Where any of these appear in both files, they
must be
identical. The size of the JAR
must be the size that appears in MIDlet-Jar-Size in the JAD.
The reason is: normally, the device downloads the JAD (from a webserver) first. The information (name, version, vendor, size) is displayed to the user. If the user confirms, the JAR is downloaded. Size and manifest values are compared, to make sure that the JAR it downloaded is exactly what the JAD said it would be.
Also: a device may refuse to install an application if it is already installed. An application is "the same as" an installed one if the MIDlet-Name, MIDlet-Vendor and MIDlet-Version match. When testing, make sure you delete old versions before installing new ones.
Some devices will reject applications if the JAD or manifest refer to features that the device does not have. For example, if MicroEdition-Profile specifies MIDP-2.0 and the device supports only MIDP-1.0. (Note that MIDP and CLDC versions are backward-compatible, so all MIDP-2.0 devices are automatically MIDP-1.0 devices as well.)
An application's code
can refer to API classes that the device does not have. This will
not usually prevent installation. (Of course, it might prevent the application from running.) For example: it is possible on most devices to detect the available APIs at run time, and load only the appropriate application classes. If an application does not install, it is
not because you are using unsupported APIs in your code.