MIDlet Message

MIDlet Messages allow you to deliver MIDlet suites to devices in a single package. Instead of delivering your MIDlet suite as separate JAD and JAR files, you can package the files in a single MIDlet Message, which mobile device users can then transfer to their devices.

MIDlet Messages are supported on S60 2nd Edition, Feature Pack 2 and newer Symbian devices. They can be delivered to devices through the same delivery channels as MIDlet suites. The MIME type of a MIDlet Message is application/java-archive.

The MIDlet Message is a single uncompressed JAR file that contains the following files:

  • JAD file for the MIDlet suite

  • JAR file for the MIDlet suite

  • Manifest file

For the full MIDlet Message format specification, see document Implementation Best Practices for OMA DRM v1.0 protected MIDlets on Nokia Developer.

Creating a MIDlet Message

To create a MIDlet Message:

  1. Create a new folder, and place the JAD and JAR files for the MIDlet suite in the root of the folder. For example:

    D:\JavaME\ExampleMessage\suite.jad

    D:\JavaME\ExampleMessage\suite.jar

  2. In the above folder, create the META-INF subfolder for the manifest file. For example:

    D:\JavaME\ExampleMessage\META-INF\

  3. In the META-INF subfolder, create the manifest.mf file. For example:

    D:\JavaME\ExampleMessage\META-INF\manifest.mf

    The manifest file is a simple text file that contains the following attributes:

    Table: MIDlet Message manifest attributes

    Name

    Supported since platform

    Description

    Value

    Distribution-Package

    S60 2nd Edition FP 2

    Specifies the version of the MIDlet Message.

    This is a mandatory attribute.

    The only supported value is 1.0:

    Distribution-Package: 1.0

    Distribution-Descriptor-Filename

    S60 2nd Edition FP 2

    Specifies the name of the MIDlet suite JAD file inside the MIDlet Message JAR file.

    This is a mandatory attribute.

    Example:

    Distribution-Descriptor-Filename: suite.jad

    Distribution-Content-Filename

    S60 2nd Edition FP 2

    Specifies the name of the MIDlet suite JAR file inside the MIDlet Message JAR file.

    This is a mandatory attribute.

    Example:

    Distribution-Content-Filename: suite.jar

    Nokia-Forward-Lock

    Java Runtime 2.1 for Symbian

    Specifies whether the MIDlet suite is installed as forward-locked. Forward-locked means that the MIDlet suite JAR file from the MIDlet Message is DRM-encrypted during installation.

    If this attribute is set to true, the MIDlet suite is installed as forward-locked. The default value is false.

    This is an optional attribute.

    Possible values:

    • true

    • false (default)

    Example:

    Nokia-Forward-Lock: true

    Here is the full contents of an example manifest.mf file:

    Distribution-Package: 1.0
    Distribution-Descriptor-Filename: suite.jad
    Distribution-Content-Filename: suite.jar
    Nokia-Forward-Lock: true
  4. Open the command prompt, and create the MIDlet Message JAR file using the jar command with the following syntax:

    <JDK installation path>\bin\jar cvf0M <message>.jar -C <message folder path> .

    For example:

    C:\jdk\bin\jar cvf0M examplemessage.jar -C D:\JavaME\ExampleMessage\ .