Push applications

MIDP 2.0 compliant devices implement a push registry that allows inactive MIDlets to be launched in response to external events, such as received SMS messages, or previously set timers. With Push, MIDlets can in a sense be run like services on a mobile device to handle certain tasks without the user's explicit interaction. While the MIDlet is active, the MIDlet itself is responsible for dealing with any push events that may occur. The AMS does not get involved at that point.

When the AMS detects an incoming connection or an alarm based activation associated with a MIDlet, the AMS starts the MIDlet and calls the startApp() method. At this point the MIDlet takes over responsibility for the connection and performs the steps necessary for handling the incoming connection.

Table 5: javax.io.PushRegistry methods

Method

Description

getFilter()

Returns the AllowedSender value for the specified push connection.

getMidlet()

Returns the Midlet responsible for handling the specified push connection.

listConnections()

Returns the list of registered push connections for the Midlet suite.

registerAlarm()

Registers a timer-based alarm to launch the Midlet. Disables alarms if it is set to zero.

registerConnection()

Registers a push connection.

unregisterConnection()

Unregisters a push connection.

The push connections in a MIDlet can be registered in two ways, statically and dynamically:.

All push connection parameters can be replaced with a wildcard *, although their excessive usage should be avoided. Several MIDlets can also have Push connections registered at the same time.

For more information on Push registration, see PushRegistry specification.