Query SMS
Last updated
Last updated
Requires READ_SMS
permission.
Add the following permission in your AndroidManifest.xml
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.
Sms Filter works like a SQL WHERE
clause. Initialize the filter by calling the where
method and pass in the column name.
Compares equality between the column values and the value provided to the function.
Adds a greater than >
operator.
Adds a less than operator.
Adds a greater than or equal to operator.
Adds a less than or equal to operator.
Checks for inequality.
Adds the LIKE
operator.
Adds the IN
operator.
Adds the BETWEEN
operator.
Adds a NOT
operator.
Adds the AND
operator between two statements.
Adds the OR
operator between two statements.
Creates an ORDER BY
statement.
Optionally you can provide a sort order. Defaults to DESC
Parameters
Type
Description
Optional
Default Value
Columns
List of SmsColumn
Columns to be returned by the query
✔️
[ SmsColumn.ID
, SmsColumn.ADDRESS
, SmsColumn.BODY
, SmsColumn.DATE
]
Filter
Filters the result by given constraints. Works like SQL WHERE
clause.
✔️
null
sortOrder
List of OrderBy
Sorts the result prioritized by order of declaration.
✔️
null
Parameters
Type
Description
Optional
Default Value
Columns
List of SmsColumn
Columns to be returned by the query
✔️
[ SmsColumn.ID
, SmsColumn.ADDRESS
, SmsColumn.BODY
, SmsColumn.DATE
]
Filter
Filters the result by given constraints. Works like SQL WHERE
clause.
✔️
null
sortOrder
List of OrderBy
Sorts the result prioritized by order of declaration.
✔️
null
Parameters
Type
Description
Optional
Default Value
Columns
List of SmsColumn
Columns to be returned by the query
✔️
[ SmsColumn.ID
, SmsColumn.ADDRESS
, SmsColumn.BODY
, SmsColumn.DATE
]
Filter
Filters the result by given constraints. Works like SQL WHERE
clause.
✔️
null
sortOrder
List of OrderBy
Sorts the result prioritized by order of declaration.
✔️
null
Property
Type
id
int
address
String
body
String
date
int
in milliseconds
dateSent
int
in milliseconds
read
bool
seen
bool
subject
String
subscriptionId
int
threadId
int
type
SmsType
status
SmsStatus
Columns
ID
ADDRESS
BODY
DATE
DATE_SENT
READ
SEEN
STATUS
SUBJECT
SUBSCRIPTION_ID
THREAD_ID
TYPE
Values
ASC
DESC