March 20, 2006

App Mgmt: Using the Push Registry in MIDP 2.0

Posted at March 20, 2006 6:41 PM in J2ME .

Introduced by MIDP 2.0, the Push Registry allows apps to be started without direct user input - at a specific time or as the result of an event like an incoming message. This functionality can be used in all sorts of ways, from responding to an event to performing certain tasks at regular intervals.

The Motorola Motocoder developer newsletter staff have written a nice technical doc that walks you through the functionality available in the Push Registry, lots of little bits of sample code to get you on your way.

The Push Registry is handled by the class javax.microedition.io.PushRegistry, and is part of the Application Management System, which handles all its events.

An alarm event is registered by specifying the MIDlet name and the time for launch.

There can only be one alarm registered for any MIDlet, therefore registering a new alarm will always overwrite any previous alarm in the Push Registry. This can be detected because the alarm registration method returns the overwritten alarm time if one existed.

The Wireless Messaging API can be used in conjunction with Push Registry to handle incoming messages by means of a Message Listener, which can implement the logic to handle the message payload after the MIDlet has been started by the AMS.

More at: Using the Push Registry in MIDP 2.0

Trackback

You can ping this entry by using http://www.mamlambo.com/mt/mt-tb.cgi/632 .

Comments

Post a comment










Remember personal info?