Methods Summary |
---|
public java.lang.String | getAddress()Gets the address from the message object as a String . If no
address is found in the message, this method returns null .
If the method is applied to an inbound message, the source address is
returned. If it is applied to an outbound message, the destination
address is returned.
The following code sample retrieves the address from a received message.
...
Message msg = conn.receive();
String addr = msg.getAddress();
...
...
return msgAddress;
|
public java.util.Date | getTimestamp()Returns the timestamp indicating when this message has been sent.
return new Date(sentAt);
|
public java.lang.String | getType()Gets the message type.
return msgType;
|
public void | setAddress(java.lang.String address)Sets the address part of the message object. The address is a
String and must be in the format:
protocol://phone_number:[port]
The following code sample assigns an address to the Message
object.
...
String addr = "protocol://+123456789";
Message msg = newMessage(MessageConnection.TEXT_MESSAGE);
msg.setAddress(addr);
...
msgAddress = address;
|
public void | setTimeStamp(long timestamp)Sets the timestamp for inbound SMS messages.
sentAt = timestamp;
|
public void | setType(java.lang.String type)Sets the message type.
if (type == null) {
throw new IllegalArgumentException("Null message type.");
}
msgType = type;
|