Implements a SMS message for the SMS message connection.
This class contains methods for manipulating message objects and their
contents. Messages can be composed of data and an address.
MessageObject contains methods that can get and set the data and
the address parts of a message separately. The data part can be either text
or binary format. The address part has the format:
sms://[phone_number:][port_number]
and represents the address of a port that can accept or receive SMS messages.
Port numbers are used to designate a specific application or communication
channel for messages. When the port number is omitted from the address, then
the message is targeted at the end user and their normal mailbox handling
application. In this case, the JSR120 MessageConnection cannot
be used to receive an inbound message to the user mailbox.
A well-written application would always check the number of segments that
would be used before sending a message, since the user is
paying for each SMS message transferred and not just the fixed rate per
high-level message sent.
Instantiating and Freeing MessageObjects
MessageObject s are instantiated when they are received from the
{@link javax.wireless.messaging.MessageConnection MessageConnection}
or by using the
{@link MessageConnection#newMessage(String type)
MessageConnection.newMessage}
message factory. Instances are freed when they are garbage collected or
when they go out of scope. |