Java Reference
In-Depth Information
public String setAddress(String address);
public String getAddress();
public boolean addAddress(String type, String address);
public String [] getAddresses(String type);
The first two methods are inherited from the Message interface. setAddress() can be used
to set the first “to” address for an outgoing message. Additional “to” addresses can be added
using the addAddress() method. addAddress() can also be used to add “cc” and “bcc” recipients.
getAddress() will return the first “to” address on an outgoing message, and the “from”
address from an incoming message. getAddresses() returns all the addresses associated with a
address type, such as “cc”, “bcc”, “to”, or “from”.
You can remove all the addresses in an address type using this method:
public void removeAddresses(String type);
Remove all the addresses in the “to”, “cc”, and “bcc” fields of a message by using the
following:
public void removeAddresses();
You can also be more selective and remove only a specific address:
public boolean removeAddress(String type, String address);
Content ID and Content Location
The content of each message part can have its own ID and location. This information is stored
in the header of the message part. The content ID uniquely identifies a message part within the
message, while the location can refer to the actual location where the content is stored (for
example, a URL accessible over the Internet). The exact syntax of these two pieces of information
and how they are used will depend on the application and/or the specific MMS
implementation.
You can read the content ID and location using the following methods on the MessagePart
interface:
public String getContentID();
public String getContentLocation();
The Start Content ID
For some applications, a particular message part in a message may contain the script or
code to start a multimedia presentation. This is similar to the concept of a main class in Java
programming. In order to signify that a particular message part can be used to start a presen-
tation, its unique content ID can be designated as a start content ID. The following two methods
help with this:
public String getStartContentId();
public void setStartContentId(String contentId);
Search WWH ::




Custom Search