Query SMS
Requires READ_SMS
permission.
Add the following permission in your AndroidManifest.xml
getInboxSms()
Returns Future<List<SmsMessage>>
Parameters | Type | Description | Optional | Default Value |
Columns | List of | Columns to be returned by the query | ✔️ | [ |
Filter | Filters the result by given constraints. Works like | ✔️ |
| |
sortOrder | List of | Sorts the result prioritized by order of declaration. | ✔️ |
|
All parameters are optional.
getSentSms()
Returns Future<List<SmsMessage>>
Parameters | Type | Description | Optional | Default Value |
Columns | List of | Columns to be returned by the query | ✔️ | [ |
Filter | Filters the result by given constraints. Works like | ✔️ |
| |
sortOrder | List of | Sorts the result prioritized by order of declaration. | ✔️ |
|
All parameters are optional.
getDraftSms()
Returns Future<List<SmsMessage>>
Parameters | Type | Description | Optional | Default Value |
Columns | List of | Columns to be returned by the query | ✔️ | [ |
Filter | Filters the result by given constraints. Works like | ✔️ |
| |
sortOrder | List of | Sorts the result prioritized by order of declaration. | ✔️ |
|
All parameters are optional.
SmsMessage
Property | Type |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SmsColumn
Columns |
|
|
|
|
|
|
|
|
|
|
|
|
SmsFilter
Generates a filter that will be used by an query. The methods read like an SQL query. The select part is determined columns
parameter on one of the query methods. The SmsFilter
handle the WHERE
part.
Example
Becomes
Initializing a filter
Sms Filter works like a SQL WHERE
clause. Initialize the filter by calling the where
method and pass in the column name.
Methods
equals()
Compares equality between the column values and the value provided to the function.
greaterThan()
Adds a greater than >
operator.
lessThan()
Adds a less than operator.
greaterThanOrEqualTo()
Adds a greater than or equal to operator.
lessThanOrEqualTo()
Adds a less than or equal to operator.
notEqualTo()
Checks for inequality.
like()
Adds the LIKE
operator.
inValues()
Adds the IN
operator.
between()
Adds the BETWEEN
operator.
not
Adds a NOT
operator.
Combining Methods
and()
Adds the AND
operator between two statements.
or()
Adds the OR
operator between two statements.
OrderBy
Creates an ORDER BY
statement.
Optionally you can provide a sort order. Defaults to DESC
Sort
Values |
|
|
Last updated