Java Reference
In-Depth Information
In addition to these privileges, your application needs the following specific
privileges to send or receive each kind of message:
javax.microedition.io.Connector.sms.receive : Required to receive a text or binary
SMS message
javax.microedition.io.Connector.sms.send : Required to send a text or binary SMS
message
javax.microedition.io.Connector.cbs.receive : Required to receive an SMS-CB
message
javax.microedition.io.Connector.mms.receive : Required to receive an MMS
message
javax.microedition.io.Connector.mms.send : Required to send an MMS message
This fine-grained use of privilege helps prevent rogue MIDlets from sending or
receiving messages without the user's approval. In addition, the AMS prompts the
user before letting the MIDlet create a MessageConnection instance or send or receive
a message.
As with other privileges, you must specify these in the MIDlet-Permissions field of
your JAD file prior to signing your MIDlet for certification and distribution.
Using the Push Registry
I first showed you the Java ME push registry in Chapter 4, where you learned how to use it
and the AMS to register an application to launch when an alarm fires. You can also use
the push registry—through the methods the PushRegistry class provides—to start your
application upon receipt of an incoming message. Figure 14-3 (which contains the same
sequence of events as Figure 4-3) shows the sequence of events when your application
registers with the push registry for an incoming message and the device receives an
incoming message for your application.
In Chapter 4, you saw only how to register for an alarm dynamically with the
PushRegistry class, which encapsulates the interfaces to the push registry.
Note The PushRegistry class provides all class methods; you don't need an instance of
PushRegistry . This is different from many other classes in the MIDP profile, where you obtain a
singleton instance of the class and invoke its methods instead.
 
Search WWH ::




Custom Search