Java Reference
In-Depth Information
The WMA uses the GCF's Connector.open method to create instances of
MessageConnection , just as you learned how to create other Connection subclasses in
Chapters 12 and 13. As with other Connection subclasses, you obtain a Connection
subclass by specifying the kind of connection you want using a URL; the format of
the URL is
protocol://recipient:port
Each portion of the URL is defined as follows:
protocol : The protocol—either cbs for SMS-CB messages, mms for MMS messages,
or sms for SMS messages
recipient : The recipient address (a phone number, short code, or e-mail address)
for MO messages; when empty, indicates that the application will use the resulting
MessageConnection to receive messages
port : The port to which the message will be sent—either a numeric port for SMS or
SMS-CB messages, or an alphanumeric string for MMS messages
When creating MessageConnection instances, you can create instances for either MO or
MT messages that use the SMS and MMS protocols, but WMA 2.0 only supports MT SMS-
CB messages. Thus, it's an error to specify a recipient in the URL you pass to Connector.open
if the protocol is cbs .
Like TCP/IP and UDP connections, SMS, SMS-CB, and MMS messages are directed to
specific ports; different applications can use different ports to differentiate the data. Some
ports may be reserved for specific applications that the phone's native software and network
use; for example, on GSM networks, the network reserves the ports listed in Table 14-1, and
attempting to send or receive SMS messages on these ports results in a SecurityException .
Some networks, such as the code division multiple access (CDMA) networks you find pre-
dominantly in North America, may not use port numbers at all, and you should omit the
port number on those networks altogether when opening a MessageConnection .
Table 14-1. Reserved Ports on GSM Networks
Port Number
Purpose
2805
WAP Wireless Telephony Application (WTA) secure, connectionless session service
2923
WAP WTA secure session service
2948
WAP push connectionless session service (client side)
2949
WAP push secure, connectionless session service (client side)
5502
Service card reader service for Subscriber Identity Module (SIM) access
5503
Internet access configuration reader
 
Search WWH ::




Custom Search