Wednesday, November 14, 2007

j2me, Permissions

MIDlets must have permission to perform sensitive operations, like connecting to the network. Permissions have specific names, and MIDlet suites can indicate their need for certain kinds of permissions through attributes in the MIDlet suite descriptor.

In the J2ME Wireless Toolkit, you can add these permission attributes to a project by clicking on the Settings... button in KToolbar. Select the Permissions tab. The MIDlet-Permissions box shows permissions which the MIDlet must possess, while the MIDlet-Permissions-Opt box contains permissions that the MIDlet would like to have but does not need absolutley.

javax.microedition.io.PushRegistry,

javax.wireless.messaging.sms.receive,

javax.wireless.messaging.sms.send,

javax.microedition.io.Connector.sms,

javax.microedition.io.Connector.socket


j2me jad or jad

The following are required application attributes, some of which must be defined in the JAD file, and others in the JAR manifest:

  • MIDlet-Name: Mandatory in JAD, optional in manifest.
  • MIDlet-Version: Mandatory in JAD, optional in manifest. Format is Major.Minor[.Micro].
  • MIDlet-Vendor: Mandatory in JAD, optional in manifest.
  • MIDlet-Jar-URL: Mandatory in JAD.
  • MIDlet-Jar-Size: Mandatory in JAD.
  • MIDlet-: For each MIDlet. Optional in JAD, required in manifest.
  • MicroEdition-Profile: Optional in JAD, mandatory in manifest.
  • MicroEdition-Configuration: Optional in JAD, mandatory in manifest.

The following are optional attributes that can be defined in the JAD or manifest:

  • MIDlet-Description: application description.
  • MIDlet-Icon: application's icon.
  • MIDlet-Info-URL: URL for MIDlet suite information page.
  • MIDlet-Data-Size: Minimum required data space.
  • MIDlet-Permissions: Requested permissions.
  • MIDlet-Permissions-Opt: Requested optional permissions.
  • MIDlet-Push-: , , . Push static registration.
  • MIDlet-Install-Notify: URL for installation notifications..
  • MIDlet-Delete-Notify: URL for deletion notifications.
  • MIDlet-Delete-Confirm: User prompt for deletions.

The following two attributes are mandatory for trusted MIDlets, and must be defined in the JAD file:

  • MIDlet-Jar-RSA-SHA1: defines the JAR signature
  • MIDlet-Certificate--: defines the public key certificate