Added in API level 19

Sms


class Sms : BaseColumns, Telephony.TextBasedSmsColumns
kotlin.Any
   ↳ android.provider.Telephony.Sms

Contains all text-based SMS messages.

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
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

Added in API level 19
static val DEFAULT_SORT_ORDER: String

The default sort order for this table.

Value: "date DESC"

Public methods

getDefaultSmsPackage

Added in API level 19
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>&lt;queries&gt;
    &lt;intent&gt;
      &lt;action android:name="android.provider.Telephony.SMS_DELIVER"/&gt;
    &lt;/intent&gt;
  &lt;/queries&gt;
  </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

Added in API level 19
static val CONTENT_URI: Uri!

The content:// style URL for this table.