Java Reference
In-Depth Information
■
Note
Because nearly all wireless terminals shipping today support WMA 2.0, what follows applies to
WMA 2.0 unless I specifically state otherwise. The key difference you need to remember between WMA 1.0
and WMA 2.0 is that WMA 2.0 adds support for SMS-CB and MMS messages.
Figure 14-1 shows the GCF classes you first saw in Chapter 12, along with the WMA-
introduced classes. WMA 1.0 defines the basic mechanism for creating instances of
messages, while WMA 2.0 defines the multipart message used to represent an MMS
message, with these classes and interfaces:
•
MessageConnection
: Acts as a factory for instances of
Message
subclasses that repre-
sent individual messages. You obtain an instance of
MessageConnection
just as you
would any other
Connection
, by specifying the type of connection in a URL you
pass to
Connector.open
.
•
Message
: The superclass of all WMA messages. It provides interfaces to manipulate
timestamps and addresses for messages.
•
TextMessage
: Represents an interface to an SMS message bearing text.
•
BinaryMessage
: Represents an interface to an SMS message bearing a binary
payload.
•
MultipartMessage
: Represents an interface to an MMS message bearing one or more
message parts. Only WMA 2.0 provides the
MultipartMessage
class.
•
MessagePart
: Represents a single part of a message, such as an image or text
segment. It's used when composing and parsing MMS messages. Only WMA 2.0
provides the
MessagePart
class.
•
MessageListener
: Provides a mechanism by which the AMS can notify your
application of an incoming message.