Java Reference
In-Depth Information
WMA API
WMA is built on top of CLDC (or CDC) and requires only the Generic Connection Framework
(GCF) of CLDC 1.0. Therefore, WMA will work well on both CLDC 1.0 and CLDC 1.1 devices.
Like SocketConnection and DatagramConnection in the GCF, you get a MessageConnection
by passing in an address to the connect() method. Unlike these other connections, however, you
cannot open an input or output stream from it. MessageConnection s are only used to send and
receive messages. All the interfaces and classes in WMA are part of the javax.wireless.messaging
package.
WMA's API is built around the GCF. Figure 11-1 shows the new APIs in WMA and how they
relate to the GCF.
Figure 11-1. Extending the GCF with WMA APIs
A typical call to open a MessageConnection for sending or receiving message may be
MessageConnector msgConn = (MessageConnector) Connector.open("sms://5550001:1234");
This will create a client mode connection. A client mode connection can only be used to
send messages. Messages sent through this connection will be destined for phone number
5550001 , port 1234.
 
Search WWH ::




Custom Search