Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries over the next few weeks. Thanks for all your past and future contributions.
Predefined UID attribute must be present in both JAD and JAR files
S60 3rd Edition FP2
In S60 3rd Edition, Feature Pack 2, the predefined UID attribute must be present in the JAD file for MIDlets using the predefined UID when starting the installation from the application descriptor (JAD).
A MIDlet can have a predefined UID attribute in the same way as native executables. Beginning from S60 3rd Edition, Feature Pack 2, this is accomplished using a new JAD/JAR manifest attribute Nokia-MIDlet-UID-<n>, where <n> stands for the MIDlet's number inside the MIDlet suite as with some other attributes.
The UID can be from the following ranges:
0x20000000-0x2FFFFFFF: "protected range", to use this the application must be signed and the attribute must be in the JAR manifest file. The UIDs in this range are requested from Symbian Signed.
0xA0000000-0xAFFFFFFF: "unprotected range", the UIDs in this range should also be requested from Symbian Signed.
0xE0000000-0xEFFFFFFF: "development use range", the UIDs in this range can be used freely but collisions may happen.
However, when the installation of a MIDlet with a predefined UID is started from JAD or JAR Manifest, the actual installation result varies between unprotected and protected ranges (see below). The importance of JAD is here especially highlighted since installation is normally started from JAD.
UIDs from the unprotected range:
- If the UID is in the JAR Manifest only and installation is started from JAD, installation succeeds but the UID is ignored. With a signed MIDlet, if only the JAD includes the UID and the installation is started from that JAD, the installation fails.
- When the installation is started from the JAD and the UID is included only in the JAD of an unsigned MIDlet or both in the JAR Manifest & JAD, the installation is successful and the UID is acknowledged. Installation started from the JAR will also be successful if the UID is included in JAR Manifest only.
UIDs from the protected range:
- If the UID is in the JAR Manifest only and installation is started from JAD, installation succeeds but the UID is ignored; in addition, the UID in JAD only results in failed installation as well as when installing an unsigned MIDlet which has the UID both in the JAR Manifest & JAD (signing is always required for MIDlets which use a UID from the protected range). The failure will also result in JAR installation when the UID is included in JAR Manifest only.
- If both the JAR Manifest & JAD include the predefined UID and the MIDlet is signed, the installation will be successful and the UID will be acknowledged.
How to reproduce
The problems resulting from having a UID attribute defined either in the JAD or JAR Manifest only can be reproduced as follows:
MIDlet using a UID from the unprotected range:
- With the UID defined in JAR Manifest only, start the installation from the JAD. The installation is successful but the UID will be ignored.
- With a signed MIDlet using a UID defined in the JAD only, start the installation from the JAD. The installation fails.
MIDlet using a UID from the protected range:
- With a signed/unsigned MIDlet using a UID defined in JAR Manifest only, start the installation from the JAD. The installation is successful, but the UID will be ignored.
- With an unsigned MIDlet using a UID defined in the JAR only, start the installation from the JAR. The installation fails.
- With a signed MIDlet using the UID defined in the JAD only, start the installation from the JAD. The installation fails.
Include the UID attribute in both the JAD and JAR MANIFEST files.