Contents Previous Next Index

Chapter   5

Publishing a MIDlet


Publishing a MIDlet suite makes it available on a web server for users to download. To do this:

  1. Ensure that your web server is configured to deliver specific MIME types for the JAD and JAR files.
  2. The MIME type for a JAD file is:

    text/vnd.sun.j2me.app-descriptor 
    

    The MIME type for a JAR file is:

    application/java-archive 
    

    See the documentation for your web server for configuration instructions.

  3. Put the JAD and JAR files in a directory that you web server can access.
  4. Create an HTML file that contains a link to your JAD file.
  5. The HTML file gives users a way to find and download your MIDlet. Finding and downloading a MIDlet is called over the air provisioning (OTA).

    The HTML file does not require any particular name or layout. When users run the midp executable to find and download MIDlets, they can enter any URL and MIDP will display only the links to JAD files at that URL. It ignores the rest of the HTML page.

    For example, an HTML page that lists the Hello World MIDlet could be called  
    get-hello.html and be as simple as this:

    <html> 
      <head><title>The Hello MIDlet</title></head> 
      <body> 
        <a href="http://localhost:8080/midlets/HelloMIDlet.jad" 
           >Hello MIDlet<a> 
      </body> 
    </html> 
    

    Note that, although no particular format for the HTML file is required, the whitespace in the file can affect the layout of the MIDlet suite name on the device. For example, if the HTML file with a link to the “Hello MIDlet” has a carriage return between the words Hello and MIDlet, the name looks like this on the device emulator:

    Odd characters in MIDlet suite name

    FIGURE 8  –  Whitespace in an HTML File Shown on a Device

  6. Put the HTML file into a web server visible directory.
  7. Test the link from the HTML page to the JAD file, and from the JAD file to the JAR file.
  8. One way to do this is to run the device emulator. See Using MIDP for instructions

 


Contents Previous Next Index Creating MIDlet Suites
MIDP Reference Implementation, Version 2.0 FCS