Posted by billday
on February 18, 2004 at 6:31 PM PST
Tips and tricks for using MIDP 2.0's Push capabilities via SMS
I receive quite a few questions related to my J2ME Archive and wireless development blogs . From time to time I'll select one that's particularly pertinent to highlight here.
For this tip, Ellick Chan (working pervasive education and integrating mobile devices into Gaia ) asked:
How can I use GSM's SMS capabilitiy to deliver push notifications to MIDlets?
The MIDP 2.0 spec allows you to push notifications to your MIDlets using any communication protocol supported by both the network and the MIDP-enabled device.
HTTP, SMS, sockets, and/or other protocols may be supported, depending on the network you're using and the device to which your notificiation is directed. You should read through the article "The MIDP 2.0 Push Registry " for a technical overview of how push works, especially from the MIDlet client perspective.
Whichever network(s) you're application will be using, you need to find out what
protocols they allow inbound to handsets. At the least, most GSM carriers will allow SMS (since they use SMS for short text messaging). Assuming your network does support SMS, from the server part of your application you would need to generate an SMS message directed to the port you bound your MIDlet to in its static or dynamic push registry settings. Assuming the network passes the SMS as expected, your MIDlet should be awakened when the SMS arrives in the handset.
Note carefully: You need to be sure you direct your incoming message to a logical port. For more information on how your server side bits need to address this port number, refer to the "GSM SMS Adapter" part of the WMA 1.1 specification .
Carrier specific developer programs should be able to provide the details on their support for sending SMS messages into their networks. Visit your carrier's developer Web site for more information (refer to the "Carriers" section of my J2ME Archive for some links to example carrier developer sites).
To learn more about the MIDlet side of things (receiving the port specific
SMS), refer to the WMA section of my presentation "Developing Wireless Applications Using MIDP 2.0, WMA, and MMA " (a webcast of this presentation is available from JavaOne Online by clicking here ).