MIDP3.0

Package java.lang

Descriptions of modified and extended features included from Java Platform Micro Edition Configurations (CLDC and CDC).

See:
          
Description

Package java.lang Description

Descriptions of modified and extended features included from Java Platform Micro Edition Configurations (CLDC and CDC). MIDP is designed to be based on either the Connected, Limited Device Configuration [CLDC] or Connected Device Configuration [CDC]. Some features of [CLDC] and [CDC] are modified or extended by MIDP.

System Functions

MIDP requires a set of modified behaviors for certain [CLDC] and [CDC] system functions related to the exit of MIDlets.

System.exit

The behavior of java.lang.System.exit MUST throw a java.lang.SecurityException when invoked by a MIDlet. The only way a MIDlet can indicate that it is complete is by calling MIDlet.notifyDestroyed.

Runtime.exit

The behavior of java.lang.Runtime.exit MUST throw a java.lang.SecurityException when invoked by a MIDlet. The only way a MIDlet can indicate that it is complete is by calling MIDlet.notifyDestroyed.

System Properties

MIDP defines the following property values (in addition to those defined in [CLDC] and [CDC]) that MUST be made available to the application using java.lang.System.getProperty. Other properties may be available from other configurations, profiles, or from the implementation.

Table 10-1 : MIDP 3.0 System Properties

System Property

Description

microedition.deviceid.uuid

A unique hardware device identifier corresponding to a UUID

microedition.deviceid.imei

A unique hardware device identifier corresponding to the device's IMEI

microedition.deviceid.esn

A unique hardware device identifier corresponding to the device's ESN

microedition.deviceid.meid

A unique hardware device identifier corresponding to the device's MEID

microedition.deviceid.pesn

A unique hardware device identifier corresponding to the device's pESN

microedition.subscriberid.uuid

A unique subscriber or user identifier represented by a UUID string

microedition.subscriberid.imsi

A unique subscriber or user identifier corresponding to an IMSI

microedition.subscriberid.msisdn

A unique subscriber or user identifier corresponding to an MSISDN

microedition.subscriberid.iccid

A unique subscriber or user identifier corresponding to an ICCID

microedition.subscriberid.euimid

A unique subscriber or user identifier corresponding to an EUIMID

microedition.locale

The current locale of the device, MUST NOT be null

microedition.profiles

is a blank (Unicode U+0020) separated list of the Java ME profiles that this device supports; this property MUST contain at least "MIDP-3.0"

microedition.platform

Name of the host platform or device

microedition.commports

A comma separated list of available logical serial ports

microedition.hostname

The local hostname (if available)

Device Identifier System Properties

Subscriber Identifier System Properties

microedition.locale

The microedition.locale property MUST include at least the language code, and SHOULD also include the country code, followed by an OPTIONAL variant, separated by "-" (Unicode U+002D). For example, fr-FR or en-US or zh-CN-Hans.

The language codes MUST be the lower-case, two-letter codes as defined by ISO 639-1:2002.

The country codes MUST be the upper-case, two-letter codes as defined by ISO 3166-1:1997.

(Note: the MIDP 1.0 specification used the HTTP formatting of language tags as defined in [RFC3066], Tags for the Identification of Languages. This is different from the Java SE definition for java.util.Locale printed strings where fields are separated by "_" (Unicode U+005F).)

microedition.profiles

The microedition.profiles system property MUST NOT contain different versions of the same profile. In particular, MIDP-1.0 and MIDP-2.x MUST NOT be listed, only MIDP-3.0.

microedition.platform

The value of the microedition.platform system property MUST conform to the following syntax :


    Manufacturer_name
    Device_model_number
    [“/”version_number ]
    [“/”additional_comments ]
                    

Manufacturer name and device model number are mandatory and MUST be concatenated without spaces between the manufacturer name and device model number. An optional version number and optional additional comments MAY be present. If present, the version number and additional comments MUST be separated from the rest of the string with a forward slash (/). The value of the property MUST NOT contain any forward slash (/) characters other than those that are used to separate the version number and additional comments from the rest of the information.

microedition.commports

The value of the microedition.commports system property MUST contain a comma separated list of available logical port names, any of which can be combined with a comm: prefix as the URL string to be used to open a serial port connection. See CommConnection for more information.

microedition.hostname

The value of the microedition.hostname system property MUST contain the host name of the local device, if it is available.

Application Resource Files

Application resource files are accessed using getResourceAsStream(String name) in java.lang.Class. In the MIDP specification, getResourceAsStream is used to allow resource files to be retrieved from MIDlet suite and LIBlet JAR files.

Resource names refer to the contents of a MIDlet Suite or LIBlet JAR. Absolute pathnames, beginning with "/" are fully qualified file names within the JAR. The resource file is loaded from the same context as the Class instance it is called upon. Only a single JAR is searched for the resource. For example, if called on a class loaded from the MIDlet Suite, the resource will be retrieved from the MIDlet Suite JAR.

Relative pathnames, not beginning with "/" are relative to the class upon which getResourceAsStream is called. Relative names are converted to absolute by prepending a "/" followed by the fully qualified package with "." characters converted to "/" and a separator of "/". The resulting string is reduced to canonical form by applying as many times as possible the following:

The canonical resource name is the absolute pathname of the resource within the JAR.

In no case can the path extend outside the JAR, and resources outside the JAR MUST NOT be accessible. For example, using "../../" does NOT point outside the JAR. If there are any remaining "." or ".." characters they are treated literally in locating the resource. No resource can exist with that name so null is returned from Class.getResourceAsStream. Also, devices SHOULD NOT allow class files to be read from the JAR as resources, but all other files MUST be accessible.

Since:
MIDP 1.0

MIDP3.0

Send a comment or suggestionVersion 3.0 of Mobile Information Device Profile Specification
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries. Copyright 2002-2009 Motorola Inc. Portions copyright 1993-2002 Sun Microsystems, Inc. and Motorola, Inc. All Rights Reserved.