SmsMessage
open classSmsMessage
| kotlin.Any | |
| ↳ | android.telephony.gsm.SmsMessage | 
A Short Message Service message.
Summary
| Nested classes | |
|---|---|
| 
            
             SMS Class enumeration.  | 
        |
| open | |
| Constants | |
|---|---|
| static Int | 
            
             16-bit encoding scheme (see TS 23.038)  | 
        
| static Int | 
            
             7-bit encoding scheme (see TS 23.038)  | 
        
| static Int | 
            
             8-bit encoding scheme (see TS 23.038)  | 
        
| static Int | 
            
             Unknown encoding scheme (see TS 23.038)  | 
        
| static Int | 
            
             The maximum number of payload bytes per message  | 
        
| static Int | 
            
             The maximum number of payload septets per message  | 
        
| static Int | 
            
             The maximum number of payload septets per message if a user data header is present.  | 
        
| Public constructors | |
|---|---|
| Public methods | |
|---|---|
| open static IntArray! | 
            calculateLength(messageBody: CharSequence!, use7bitOnly: Boolean)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.  | 
        
| open static IntArray! | 
            calculateLength(messageBody: String!, use7bitOnly: Boolean)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.  | 
        
| open static SmsMessage! | 
            createFromPdu(pdu: ByteArray!)Create an SmsMessage from a raw PDU.  | 
        
| open String! | 
            
             Returns the message body, or email message body if this message was from an email gateway.  | 
        
| open String! | 
            
             Returns the originating address, or email from address if this message was from an email gateway.  | 
        
| open String! | |
| open String! | |
| open Int | 
            
             Returns the record index of the message on the SIM (1-based index).  | 
        
| open String! | 
            
             Returns the message body as a String, if it exists and is text based.  | 
        
| open SmsMessage.MessageClass! | 
            
             Returns the class of this message.  | 
        
| open String! | 
            
             Returns the originating address (sender) of this SMS message in String form or null if unavailable  | 
        
| open ByteArray! | 
            getPdu()Returns the raw PDU for the message.  | 
        
| open Int | 
            
             Get protocol identifier.  | 
        
| open String! | 
            
             Unofficial convention of a subject line enclosed in parens empty string if not present  | 
        
| open String! | 
            
             Returns the address of the SMS service center that relayed this message or null if there is none.  | 
        
| open Int | 
            
             GSM: For an SMS-STATUS-REPORT message, this returns the status field from the status report.  | 
        
| open Int | 
            
             Returns the status of the message on the SIM (read, unread, sent, unsent).  | 
        
| open static SmsMessage.SubmitPdu! | 
            getSubmitPdu(scAddress: String!, destinationAddress: String!, message: String!, statusReportRequested: Boolean)Get an SMS-SUBMIT PDU for a destination address and a message  | 
        
| open static SmsMessage.SubmitPdu! | 
            getSubmitPdu(scAddress: String!, destinationAddress: String!, destinationPort: Short, data: ByteArray!, statusReportRequested: Boolean)Get an SMS-SUBMIT PDU for a data message to a destination address & port  | 
        
| open static Int | 
            getTPLayerLengthForPDU(pdu: String!)Get the TP-Layer-Length for the given SMS-SUBMIT PDU Basically, the length in bytes (not hex chars) less the SMSC header  | 
        
| open Long | 
            
             Returns the service centre timestamp in currentTimeMillis() format  | 
        
| open ByteArray! | 
            
             returns the user data section minus the user data header if one was present.  | 
        
| open Boolean | 
            
             Returns true for CPHS MWI toggle message.  | 
        
| open Boolean | 
            isEmail()Returns true if message is an email.  | 
        
| open Boolean | 
            
             returns true if this message is a CPHS voicemail / message waiting indicator (MWI) clear message  | 
        
| open Boolean | 
            
             returns true if this message is a CPHS voicemail / message waiting indicator (MWI) set message  | 
        
| open Boolean | 
            
             returns true if this message is a "Message Waiting Indication Group: Discard Message" notification and should not be stored.  | 
        
| open Boolean | 
            
             See TS 23.  | 
        
| open Boolean | 
            
             Returns true iff the   | 
        
| open Boolean | 
            
             Return true iff the message is a SMS-STATUS-REPORT message.  | 
        
Constants
ENCODING_16BIT
static valENCODING_16BIT: Int
Deprecated: Use android.telephony.SmsMessage.
16-bit encoding scheme (see TS 23.038)
Value: 3ENCODING_7BIT
static valENCODING_7BIT: Int
Deprecated: Use android.telephony.SmsMessage.
7-bit encoding scheme (see TS 23.038)
Value: 1ENCODING_8BIT
static valENCODING_8BIT: Int
Deprecated: Use android.telephony.SmsMessage.
8-bit encoding scheme (see TS 23.038)
Value: 2ENCODING_UNKNOWN
static valENCODING_UNKNOWN: Int
Deprecated: Use android.telephony.SmsMessage.
Unknown encoding scheme (see TS 23.038)
Value: 0MAX_USER_DATA_BYTES
static valMAX_USER_DATA_BYTES: Int
Deprecated: Use android.telephony.SmsMessage.
The maximum number of payload bytes per message
Value: 140MAX_USER_DATA_SEPTETS
static valMAX_USER_DATA_SEPTETS: Int
Deprecated: Use android.telephony.SmsMessage.
The maximum number of payload septets per message
Value: 160MAX_USER_DATA_SEPTETS_WITH_HEADER
static valMAX_USER_DATA_SEPTETS_WITH_HEADER: Int
Deprecated: Use android.telephony.SmsMessage.
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.
Value: 153Public constructors
Public methods
calculateLength
open static funcalculateLength(
messageBody: CharSequence!,
use7bitOnly: Boolean
): IntArray!
Deprecated: Use android.telephony.SmsMessage.
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.
| Parameters | |
|---|---|
messageBody | 
            CharSequence!: the message to encode | 
use7bitOnly | 
            Boolean: 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. | 
| Return | |
|---|---|
IntArray! | 
            an int[4] with int[0] being the number of SMS's required, int[1] the number of code units used, and int[2] is the number of code units remaining until the next message. int[3] is the encoding type that should be used for the message. | 
calculateLength
open static funcalculateLength(
messageBody: String!,
use7bitOnly: Boolean
): IntArray!
Deprecated: Use android.telephony.SmsMessage.
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.
| Parameters | |
|---|---|
messageBody | 
            String!: the message to encode | 
use7bitOnly | 
            Boolean: 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. | 
| Return | |
|---|---|
IntArray! | 
            an int[4] with int[0] being the number of SMS's required, int[1] the number of code units used, and int[2] is the number of code units remaining until the next message. int[3] is the encoding type that should be used for the message. | 
createFromPdu
open static funcreateFromPdu(pdu: ByteArray!): SmsMessage!
Deprecated: Use android.telephony.SmsMessage.
Create an SmsMessage from a raw PDU.
getDisplayMessageBody
open fungetDisplayMessageBody(): String!
Deprecated: Use android.telephony.SmsMessage.
Returns the message body, or email message body if this message was from an email gateway. Returns null if message body unavailable.
getDisplayOriginatingAddress
open fungetDisplayOriginatingAddress(): String!
Deprecated: Use android.telephony.SmsMessage.
Returns the originating address, or email from address if this message was from an email gateway. Returns null if originating address unavailable.
getEmailBody
open fungetEmailBody(): String!
Deprecated: Use android.telephony.SmsMessage.
| Return | |
|---|---|
String! | 
            if isEmail() is true, body of the email sent through the gateway. null otherwise | 
getEmailFrom
open fungetEmailFrom(): String!
Deprecated: Use android.telephony.SmsMessage.
| Return | |
|---|---|
String! | 
            if isEmail() is true, email from address of email sent through the gateway. null otherwise | 
getIndexOnSim
open fungetIndexOnSim(): Int
Deprecated: Use android.telephony.SmsMessage and getIndexOnIcc instead.
Returns the record index of the message on the SIM (1-based index).
| Return | |
|---|---|
Int | 
            the record index of the message on the SIM, or -1 if this SmsMessage was not created from a SIM SMS EF record. | 
getMessageBody
open fungetMessageBody(): String!
Deprecated: Use android.telephony.SmsMessage.
Returns the message body as a String, if it exists and is text based.
| Return | |
|---|---|
String! | 
            message body is there is one, otherwise null | 
getMessageClass
open fungetMessageClass(): SmsMessage.MessageClass!
Deprecated: Use android.telephony.SmsMessage.
Returns the class of this message.
getOriginatingAddress
open fungetOriginatingAddress(): String!
Deprecated: Use android.telephony.SmsMessage.
Returns the originating address (sender) of this SMS message in String form or null if unavailable
getPdu
open fungetPdu(): ByteArray!
Deprecated: Use android.telephony.SmsMessage.
Returns the raw PDU for the message.
| Return | |
|---|---|
ByteArray! | 
            the raw PDU for the message. | 
getProtocolIdentifier
open fungetProtocolIdentifier(): Int
Deprecated: Use android.telephony.SmsMessage.
Get protocol identifier.
getPseudoSubject
open fungetPseudoSubject(): String!
Deprecated: Use android.telephony.SmsMessage.
Unofficial convention of a subject line enclosed in parens empty string if not present
getServiceCenterAddress
open fungetServiceCenterAddress(): String!
Deprecated: Use android.telephony.SmsMessage.
Returns the address of the SMS service center that relayed this message or null if there is none.
getStatus
open fungetStatus(): Int
Deprecated: Use android.telephony.SmsMessage.
GSM: For an SMS-STATUS-REPORT message, this returns the status field from the status report. This field indicates the status of a previously submitted SMS, if requested. See TS 23.040, 9.2.3.15 TP-Status for a description of values. CDMA: For not interfering with status codes from GSM, the value is shifted to the bits 31-16. The value is composed of an error class (bits 25-24) and a status code (bits 23-16). Possible codes are described in C.S0015-B, v2.0, 4.5.21.
| Return | |
|---|---|
Int | 
            0 indicates the previously sent message was received. See TS 23.040, 9.9.2.3.15 and C.S0015-B, v2.0, 4.5.21 for a description of other possible values. | 
getStatusOnSim
open fungetStatusOnSim(): Int
Deprecated: Use android.telephony.SmsMessage and getStatusOnIcc instead.
Returns the status of the message on the SIM (read, unread, sent, unsent).
| Return | |
|---|---|
Int | 
            the status of the message on the SIM. These are: SmsManager.STATUS_ON_SIM_FREE SmsManager.STATUS_ON_SIM_READ SmsManager.STATUS_ON_SIM_UNREAD SmsManager.STATUS_ON_SIM_SEND SmsManager.STATUS_ON_SIM_UNSENT | 
getSubmitPdu
open static fungetSubmitPdu(
scAddress: String!,
destinationAddress: String!,
message: String!,
statusReportRequested: Boolean
): SmsMessage.SubmitPdu!
Deprecated: Use android.telephony.SmsMessage.
Get an SMS-SUBMIT PDU for a destination address and a message
| Parameters | |
|---|---|
scAddress | 
            String!: Service Centre address. Null means use default. | 
| Return | |
|---|---|
SmsMessage.SubmitPdu! | 
            a SubmitPdu containing the encoded SC address, if applicable, and the encoded message. Returns null on encode error. | 
          
getSubmitPdu
open static fungetSubmitPdu(
scAddress: String!,
destinationAddress: String!,
destinationPort: Short,
data: ByteArray!,
statusReportRequested: Boolean
): SmsMessage.SubmitPdu!
Deprecated: Use android.telephony.SmsMessage.
Get an SMS-SUBMIT PDU for a data message to a destination address & port
| Parameters | |
|---|---|
scAddress | 
            String!: Service Centre address. null == use default | 
destinationAddress | 
            String!: the address of the destination for the message | 
destinationPort | 
            Short: the port to deliver the message to at the destination | 
data | 
            ByteArray!: the dat for the message | 
| Return | |
|---|---|
SmsMessage.SubmitPdu! | 
            a SubmitPdu containing the encoded SC address, if applicable, and the encoded message. Returns null on encode error. | 
          
getTPLayerLengthForPDU
open static fungetTPLayerLengthForPDU(pdu: String!): Int
Deprecated: Use android.telephony.SmsMessage.
Get the TP-Layer-Length for the given SMS-SUBMIT PDU Basically, the length in bytes (not hex chars) less the SMSC header
getTimestampMillis
open fungetTimestampMillis(): Long
Deprecated: Use android.telephony.SmsMessage.
Returns the service centre timestamp in currentTimeMillis() format
getUserData
open fungetUserData(): ByteArray!
Deprecated: Use android.telephony.SmsMessage.
returns the user data section minus the user data header if one was present.
isCphsMwiMessage
open funisCphsMwiMessage(): Boolean
Deprecated: Use android.telephony.SmsMessage.
Returns true for CPHS MWI toggle message.
| Return | |
|---|---|
Boolean | 
            true if this is a CPHS MWI toggle message See CPHS 4.2 section B.4.2 | 
isEmail
open funisEmail(): Boolean
Deprecated: Use android.telephony.SmsMessage.
Returns true if message is an email.
| Return | |
|---|---|
Boolean | 
            true if this message came through an email gateway and email sender / subject / parsed body are available | 
isMWIClearMessage
open funisMWIClearMessage(): Boolean
Deprecated: Use android.telephony.SmsMessage.
returns true if this message is a CPHS voicemail / message waiting indicator (MWI) clear message
isMWISetMessage
open funisMWISetMessage(): Boolean
Deprecated: Use android.telephony.SmsMessage.
returns true if this message is a CPHS voicemail / message waiting indicator (MWI) set message
isMwiDontStore
open funisMwiDontStore(): Boolean
Deprecated: Use android.telephony.SmsMessage.
returns true if this message is a "Message Waiting Indication Group: Discard Message" notification and should not be stored.
isReplace
open funisReplace(): Boolean
Deprecated: Use android.telephony.SmsMessage.
See TS 23.040 9.2.3.9 returns true if this is a "replace short message" SMS
isReplyPathPresent
open funisReplyPathPresent(): Boolean
Deprecated: Use android.telephony.SmsMessage.
Returns true iff the TP-Reply-Path bit is set in this message.
isStatusReportMessage
open funisStatusReportMessage(): Boolean
Deprecated: Use android.telephony.SmsMessage.
Return true iff the message is a SMS-STATUS-REPORT message.