java.lang.Object | |
↳ | android.telephony.gsm.SmsMessage |
A Short Message Service message.
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
SmsMessage.MessageClass | SMS Class enumeration. | ||||||||||
SmsMessage.SubmitPdu | This class represents the encoded form of an outgoing SMS. |
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
int | ENCODING_16BIT | 16-bit encoding scheme (see TS 23.038) | |||||||||
int | ENCODING_7BIT | 7-bit encoding scheme (see TS 23.038) | |||||||||
int | ENCODING_8BIT | 8-bit encoding scheme (see TS 23.038) | |||||||||
int | ENCODING_UNKNOWN | Unknown encoding scheme (see TS 23.038) | |||||||||
int | MAX_USER_DATA_BYTES | The maximum number of payload bytes per message | |||||||||
int | MAX_USER_DATA_SEPTETS | The maximum number of payload septets per message | |||||||||
int | MAX_USER_DATA_SEPTETS_WITH_HEADER | The maximum number of payload septets per message if a user data header is present. |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Calculates the number of SMS's required to encode the message body and
the number of characters remaining until the next message, given the
current encoding.
| |||||||||||
Calculates the number of SMS's required to encode the message body and
the number of characters remaining until the next message, given the
current encoding.
| |||||||||||
Create an SmsMessage from a raw PDU.
| |||||||||||
Returns the message body, or email message body if this message was from
an email gateway.
| |||||||||||
Returns the originating address, or email from address if this message
was from an email gateway.
| |||||||||||
Returns the record index of the message on the SIM (1-based index).
| |||||||||||
Returns the message body as a String, if it exists and is text based.
| |||||||||||
Returns the class of this message.
| |||||||||||
Returns the originating address (sender) of this SMS message in String
form or null if unavailable
| |||||||||||
Returns the raw PDU for the message.
| |||||||||||
Get protocol identifier.
| |||||||||||
Unofficial convention of a subject line enclosed in parens empty string
if not present
| |||||||||||
Returns the address of the SMS service center that relayed this message
or null if there is none.
| |||||||||||
For an SMS-STATUS-REPORT message, this returns the status field from
the status report.
| |||||||||||
Returns the status of the message on the SIM (read, unread, sent, unsent).
| |||||||||||
Get an SMS-SUBMIT PDU for a data message to a destination address & port
| |||||||||||
Get an SMS-SUBMIT PDU for a destination address and a message
| |||||||||||
Get the TP-Layer-Length for the given SMS-SUBMIT PDU Basically, the
length in bytes (not hex chars) less the SMSC header
| |||||||||||
Returns the service centre timestamp in currentTimeMillis() format
| |||||||||||
returns the user data section minus the user data header if one was
present.
| |||||||||||
Returns true for CPHS MWI toggle message.
| |||||||||||
Returns true if message is an email.
| |||||||||||
returns true if this message is a CPHS voicemail / message waiting
indicator (MWI) clear message
| |||||||||||
returns true if this message is a CPHS voicemail / message waiting
indicator (MWI) set message
| |||||||||||
returns true if this message is a "Message Waiting Indication Group:
Discard Message" notification and should not be stored.
| |||||||||||
See TS 23.040 9.2.3.9 returns true if this is a "replace short message"
SMS
| |||||||||||
Returns true iff the
TP-Reply-Path bit is set in
this message. | |||||||||||
Return true iff the message is a SMS-STATUS-REPORT message.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class java.lang.Object
|
16-bit encoding scheme (see TS 23.038)
7-bit encoding scheme (see TS 23.038)
8-bit encoding scheme (see TS 23.038)
Unknown encoding scheme (see TS 23.038)
The maximum number of payload bytes per message
The maximum number of payload septets per message
The maximum number of payload septets per message if a user data header is present. This assumes the header only contains the CONCATENATED_8_BIT_REFERENCE element.
Calculates the number of SMS's required to encode the message body and the number of characters remaining until the next message, given the current encoding.
messageBody | the message to encode |
---|---|
use7bitOnly | if true, characters that are not part of the GSM alphabet are counted as a single space char. If false, a messageBody containing non-GSM alphabet characters is calculated for 16-bit encoding. |
Calculates the number of SMS's required to encode the message body and the number of characters remaining until the next message, given the current encoding.
messageBody | the message to encode |
---|---|
use7bitOnly | if true, characters that are not part of the GSM alphabet are counted as a single space char. If false, a messageBody containing non-GSM alphabet characters is calculated for 16-bit encoding. |
Create an SmsMessage from a raw PDU.
Returns the message body, or email message body if this message was from an email gateway. Returns null if message body unavailable.
Returns the originating address, or email from address if this message was from an email gateway. Returns null if originating address unavailable.
Returns the record index of the message on the SIM (1-based index).
Returns the message body as a String, if it exists and is text based.
Returns the class of this message.
Returns the originating address (sender) of this SMS message in String form or null if unavailable
Returns the raw PDU for the message.
Get protocol identifier.
Unofficial convention of a subject line enclosed in parens empty string if not present
Returns the address of the SMS service center that relayed this message or null if there is none.
For an SMS-STATUS-REPORT message, this returns the status field from the status report. This field indicates the status of a previousely submitted SMS, if requested. See TS 23.040, 9.2.3.15 TP-Status for a description of values.
Returns the status of the message on the SIM (read, unread, sent, unsent).
Get an SMS-SUBMIT PDU for a data message to a destination address & port
scAddress | Service Centre address. null == use default |
---|---|
destinationAddress | the address of the destination for the message |
destinationPort | the port to deliver the message to at the destination |
data | the dat for the message |
SubmitPdu
containing the encoded SC
address, if applicable, and the encoded message.
Returns null on encode error.
Get an SMS-SUBMIT PDU for a destination address and a message
scAddress | Service Centre address. Null means use default. |
---|
SubmitPdu
containing the encoded SC
address, if applicable, and the encoded message.
Returns null on encode error.
Get the TP-Layer-Length for the given SMS-SUBMIT PDU Basically, the length in bytes (not hex chars) less the SMSC header
Returns the service centre timestamp in currentTimeMillis() format
returns the user data section minus the user data header if one was present.
Returns true for CPHS MWI toggle message.
Returns true if message is an email.
returns true if this message is a CPHS voicemail / message waiting indicator (MWI) clear message
returns true if this message is a CPHS voicemail / message waiting indicator (MWI) set message
returns true if this message is a "Message Waiting Indication Group: Discard Message" notification and should not be stored.
See TS 23.040 9.2.3.9 returns true if this is a "replace short message" SMS
Returns true iff the TP-Reply-Path
bit is set in
this message.
Return true iff the message is a SMS-STATUS-REPORT message.