Stay organized with collections
Save and categorize content based on your preferences.
Sms
class Sms : BaseColumns, Telephony.TextBasedSmsColumns
Contains all text-based SMS messages.
Access to SMS Messages containing an SMS retriever hash (Base64 encoded SHA256 hash of an app's signing certificate, truncated to 11 characters) is delayed by 3 hours after reception. However, certain apps are exempt from this delay, and can access these SMS messages immediately upon receipt, if they hold the READ_SMS permission. These exempted apps are:
- The default SMS app
- The default Assistant app
- The default Dialer app
- Carrier apps
- Connected device companion apps
- System apps
- Known signer apps
- The SYSTEM_UI_INTELLIGENCE role holding app
Summary
| Nested classes |
|
Contains a view of SMS conversations (also referred to as threads).
|
|
Contains all draft text-based SMS messages in the SMS app.
|
|
Contains all text-based SMS messages in the SMS app inbox.
|
|
Contains constants for SMS related Intents that are broadcast.
|
|
Contains all pending outgoing text-based SMS messages.
|
|
Contains all sent text-based SMS messages in the SMS app.
|
| Constants |
| static String |
The default sort order for this table.
|
| Inherited constants |
From class TextBasedSmsColumns
String |
ADDRESS
The address of the other party.
Type: TEXT
|
String |
BODY
The body of the message.
Type: TEXT
|
String |
CREATOR
The identity of the sender of a sent message. It is usually the package name of the app which sends the message.
Note: This column is read-only. It is set by the provider and can not be changed by apps.
Type: TEXT
|
String |
DATE
The date the message was received.
Type: INTEGER (long)
|
String |
DATE_SENT
The date the message was sent.
Type: INTEGER (long)
|
String |
ERROR_CODE
Error code associated with sending or receiving this message
Type: INTEGER
|
String |
LOCKED
Is the message locked?
Type: INTEGER (boolean)
|
Int |
MESSAGE_TYPE_ALL
Message type: all messages.
|
Int |
MESSAGE_TYPE_DRAFT
Message type: drafts.
|
Int |
MESSAGE_TYPE_FAILED
Message type: failed outgoing message.
|
Int |
MESSAGE_TYPE_INBOX
Message type: inbox.
|
Int |
MESSAGE_TYPE_OUTBOX
Message type: outbox.
|
Int |
MESSAGE_TYPE_QUEUED
Message type: queued to send later.
|
Int |
MESSAGE_TYPE_SENT
Message type: sent messages.
|
String |
PERSON
The ID of the sender of the conversation, if present.
Type: INTEGER (reference to item in content://contacts/people)
|
String |
PROTOCOL
The protocol identifier code.
Type: INTEGER
|
String |
READ
Has the message been read?
Type: INTEGER (boolean)
|
String |
REPLY_PATH_PRESENT
Is the TP-Reply-Path flag set?
Type: BOOLEAN
|
String |
SEEN
Has the message been seen by the user? The "seen" flag determines whether we need to show a notification.
Type: INTEGER (boolean)
|
String |
SERVICE_CENTER
The service center (SC) through which to send the message, if present.
Type: TEXT
|
String |
STATUS
TP-Status value for the message, or -1 if no status has been received.
Type: INTEGER
|
Int |
STATUS_COMPLETE
TP-Status: complete.
|
Int |
STATUS_FAILED
TP-Status: failed.
|
Int |
STATUS_NONE
TP-Status: no status received.
|
Int |
STATUS_PENDING
TP-Status: pending.
|
String |
SUBJECT
The subject of the message, if present.
Type: TEXT
|
String |
SUBSCRIPTION_ID
The subscription to which the message belongs to. Its value will be < 0 if the sub id cannot be determined.
Type: INTEGER (long)
|
String |
THREAD_ID
The thread ID of the message.
Type: INTEGER
|
String |
TRANSACTION_ID
The transaction-id of the message.
This column is used by the default messaging app to associate an internal transaction identifier with a specific SMS message record in the database.
The platform stores the value provided in this column but treats it as an opaque field. It does not interpret, validate or use the contents of this column for any platform logic.
Type: TEXT
|
String |
TYPE
The type of message.
Type: INTEGER
|
|
|
|
| Public methods |
| static String! |
Used to determine the currently configured default SMS package.
|
| Properties |
| static Uri! |
The content:// style URL for this table.
|
Constants
DEFAULT_SORT_ORDER
static val DEFAULT_SORT_ORDER: String
The default sort order for this table.
Value: "date DESC"
Public methods
getDefaultSmsPackage
static fun getDefaultSmsPackage(context: Context!): String!
Used to determine the currently configured default SMS package.
As of Android 11 apps will need specific permission to query other packages. To use this method an app must include in their AndroidManifest:
<code><queries>
<intent>
<action android:name="android.provider.Telephony.SMS_DELIVER"/>
</intent>
</queries>
</code>
Which will allow them to query packages which declare intent filters that include the
android.provider.Telephony.Sms.Intents#SMS_DELIVER_ACTION intent.
| Parameters |
context |
Context!: context of the requesting application |
| Return |
String! |
package name for the default SMS package or null |
Properties
CONTENT_URI
static val CONTENT_URI: Uri!
The content:// style URL for this table.
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2026-03-26 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2026-03-26 UTC."],[],[]]