For security purposes the MIDletStateHandler is the anchor of trust internally for the MIDP API, restricted methods obtain the MIDletStateHandler for a MIDlet suite in order to check the properties and actions of a suite. Because of this, there MUST only be one a MIDlet suite per MIDletStateHandler.
The MIDletStateHandler handles state transitions for a MIDlet. MIDP Optimized Implementation software has more states than those listed in the MIDP Specification (which are paused, active, and destroyed). The additional states are active pending, pause pending, and destroy pending. The state processing for a MIDlet is described in the table and illustrated in figure below.
State | Description |
---|---|
Active Pending | The starting state. For MIDlets in this state, the MIDlet state handler moves the MIDlet to the active state, and calls the MIDlet's startApp method. |
Active | For MIDlets in this state, the MIDlet state handler does nothing. A MIDlet leaves the active state because of an event outside the MIDlet state handler, such as the user exiting the MIDlet. |
Pause Pending | For MIDlets in this state, the MIDlet state handler moves the MIDlet to the paused state and calls the MIDlet's pauseApp method. |
Paused | For MIDlets in this state, the MIDlet state handler does nothing. A MIDlet leaves the active state because of an event outside the MIDlet state handler, such as the MIDlet requesting its reactivation. |
Destroy Pending | For MIDlets in this state, the MIDlet state handler moves the MIDlet to the destroyed state and calls the MIDlet's destroyApp method. |
Destroyed | The final state. For MIDlets in this state, the MIDlet state handler removes the MIDlet from the list of running MIDlets. |
A MIDlet can be placed in paused state by either the system or itself, as indicated by the figure above. A MIDlet pauses itself by calling its pauseNotify method. However, as of MIDP 2.0 there is no longer any reason for this to happen for the following reasons:
MIDlet can be paused if desired by a device manufacture by using the MIDletProxy class or the native application manager API. The common reasons for customizing a system to pause MIDlets are: