DatabaseUtils
open class DatabaseUtils
kotlin.Any | |
↳ | android.database.DatabaseUtils |
Static utility methods for dealing with databases and Cursor
s.
Summary
Nested classes | |
---|---|
open |
This class allows users to do multiple inserts into a table using the same statement. |
Constants | |
---|---|
static Int |
One of the values returned by |
static Int |
One of the values returned by |
static Int |
One of the values returned by |
static Int |
One of the values returned by |
static Int |
One of the values returned by |
static Int |
One of the values returned by |
static Int |
One of the values returned by |
static Int |
One of the values returned by |
static Int |
One of the values returned by |
static Int |
One of the values returned by |
Public constructors | |
---|---|
Public methods | |
---|---|
open static Unit |
appendEscapedSQLString(sb: StringBuilder!, sqlString: String!) Appends an SQL string to the given StringBuilder, including the opening and closing single quotes. |
open static Array<String!>! |
appendSelectionArgs(originalValues: Array<String!>!, newValues: Array<String!>!) Appends one set of selection args to another. |
static Unit |
appendValueToSql(sql: StringBuilder!, value: Any!) Appends an Object to an SQL string with the proper escaping, etc. |
open static Unit |
bindObjectToProgram(prog: SQLiteProgram!, index: Int, value: Any!) Binds the given Object to the given SQLiteProgram using the proper typing. |
open static ParcelFileDescriptor! |
blobFileDescriptorForQuery(db: SQLiteDatabase!, query: String!, selectionArgs: Array<String!>!) Utility method to run the query on the db and return the blob value in the first column of the first row. |
open static ParcelFileDescriptor! |
blobFileDescriptorForQuery(prog: SQLiteStatement!, selectionArgs: Array<String!>!) Utility method to run the pre-compiled query and return the blob value in the first column of the first row. |
open static String! |
concatenateWhere(a: String!, b: String!) Concatenates two SQL WHERE clauses, handling empty or null values. |
open static Unit |
createDbFromSqlStatements(context: Context!, dbName: String!, dbVersion: Int, sqlStatements: String!) Creates a db and populates it with the sql statements in sqlStatements. |
open static Unit |
cursorDoubleToContentValues(cursor: Cursor!, field: String!, values: ContentValues!, key: String!) Reads a Double out of a field in a Cursor and writes it to a Map. |
open static Unit |
cursorDoubleToContentValuesIfPresent(cursor: Cursor!, values: ContentValues!, column: String!) Reads a Double out of a column in a Cursor and writes it to a ContentValues. |
open static Unit |
cursorDoubleToCursorValues(cursor: Cursor!, field: String!, values: ContentValues!) Reads a Double out of a field in a Cursor and writes it to a Map. |
open static Unit |
cursorFloatToContentValuesIfPresent(cursor: Cursor!, values: ContentValues!, column: String!) Reads a Float out of a column in a Cursor and writes it to a ContentValues. |
open static Unit |
cursorIntToContentValues(cursor: Cursor!, field: String!, values: ContentValues!) Reads an Integer out of a field in a Cursor and writes it to a Map. |
open static Unit |
cursorIntToContentValues(cursor: Cursor!, field: String!, values: ContentValues!, key: String!) Reads a Integer out of a field in a Cursor and writes it to a Map. |
open static Unit |
cursorIntToContentValuesIfPresent(cursor: Cursor!, values: ContentValues!, column: String!) Reads a Integer out of a column in a Cursor and writes it to a ContentValues. |
open static Unit |
cursorLongToContentValues(cursor: Cursor!, field: String!, values: ContentValues!) Reads a Long out of a field in a Cursor and writes it to a Map. |
open static Unit |
cursorLongToContentValues(cursor: Cursor!, field: String!, values: ContentValues!, key: String!) Reads a Long out of a field in a Cursor and writes it to a Map. |
open static Unit |
cursorLongToContentValuesIfPresent(cursor: Cursor!, values: ContentValues!, column: String!) Reads a Long out of a column in a Cursor and writes it to a ContentValues. |
open static Unit |
cursorRowToContentValues(cursor: Cursor!, values: ContentValues!) Read the entire contents of a cursor row and store them in a ContentValues. |
open static Unit |
cursorShortToContentValuesIfPresent(cursor: Cursor!, values: ContentValues!, column: String!) Reads a Short out of a column in a Cursor and writes it to a ContentValues. |
open static Unit |
cursorStringToContentValues(cursor: Cursor!, field: String!, values: ContentValues!) Reads a String out of a field in a Cursor and writes it to a Map. |
open static Unit |
cursorStringToContentValues(cursor: Cursor!, field: String!, values: ContentValues!, key: String!) Reads a String out of a field in a Cursor and writes it to a Map. |
open static Unit |
cursorStringToContentValuesIfPresent(cursor: Cursor!, values: ContentValues!, column: String!) Reads a String out of a column in a Cursor and writes it to a ContentValues. |
open static Unit |
cursorStringToInsertHelper(cursor: Cursor!, field: String!, inserter: DatabaseUtils.InsertHelper!, index: Int) Reads a String out of a field in a Cursor and writes it to an InsertHelper. |
open static Unit |
dumpCurrentRow(cursor: Cursor!) Prints the contents of a Cursor's current row to System. |
open static Unit |
dumpCurrentRow(cursor: Cursor!, stream: PrintStream!) Prints the contents of a Cursor's current row to a PrintSteam. |
open static Unit |
dumpCurrentRow(cursor: Cursor!, sb: StringBuilder!) Prints the contents of a Cursor's current row to a StringBuilder. |
open static String! |
dumpCurrentRowToString(cursor: Cursor!) Dump the contents of a Cursor's current row to a String. |
open static Unit |
dumpCursor(cursor: Cursor!) Prints the contents of a Cursor to System. |
open static Unit |
dumpCursor(cursor: Cursor!, stream: PrintStream!) Prints the contents of a Cursor to a PrintSteam. |
open static Unit |
dumpCursor(cursor: Cursor!, sb: StringBuilder!) Prints the contents of a Cursor to a StringBuilder. |
open static String! |
dumpCursorToString(cursor: Cursor!) Prints the contents of a Cursor to a String. |
open static String! |
getCollationKey(name: String!) return the collation key |
open static String! |
getHexCollationKey(name: String!) return the collation key in hex format |
open static Int |
getSqlStatementType(sql: String!) Returns one of the following which represent the type of the given SQL statement. |
open static Long |
longForQuery(db: SQLiteDatabase!, query: String!, selectionArgs: Array<String!>!) Utility method to run the query on the db and return the value in the first column of the first row. |
open static Long |
longForQuery(prog: SQLiteStatement!, selectionArgs: Array<String!>!) Utility method to run the pre-compiled query and return the value in the first column of the first row. |
open static Long |
queryNumEntries(db: SQLiteDatabase!, table: String!) Query the table for the number of rows in the table. |
open static Long |
queryNumEntries(db: SQLiteDatabase!, table: String!, selection: String!) Query the table for the number of rows in the table. |
open static Long |
queryNumEntries(db: SQLiteDatabase!, table: String!, selection: String!, selectionArgs: Array<String!>!) Query the table for the number of rows in the table. |
static Unit |
readExceptionFromParcel(reply: Parcel!) Special function for reading an exception result from the header of a parcel, to be used after receiving the result of a transaction. |
open static Unit | |
open static Unit | |
open static String! |
sqlEscapeString(value: String!) SQL-escape a string. |
open static String! |
stringForQuery(db: SQLiteDatabase!, query: String!, selectionArgs: Array<String!>!) Utility method to run the query on the db and return the value in the first column of the first row. |
open static String! |
stringForQuery(prog: SQLiteStatement!, selectionArgs: Array<String!>!) Utility method to run the pre-compiled query and return the value in the first column of the first row. |
static Unit |
writeExceptionToParcel(reply: Parcel!, e: Exception!) Special function for writing an exception result at the header of a parcel, to be used when returning an exception from a transaction. |
Constants
STATEMENT_ABORT
static val STATEMENT_ABORT: Int
One of the values returned by getSqlStatementType(java.lang.String)
.
Value: 6
STATEMENT_ATTACH
static val STATEMENT_ATTACH: Int
One of the values returned by getSqlStatementType(java.lang.String)
.
Value: 3
STATEMENT_BEGIN
static val STATEMENT_BEGIN: Int
One of the values returned by getSqlStatementType(java.lang.String)
.
Value: 4
STATEMENT_COMMIT
static val STATEMENT_COMMIT: Int
One of the values returned by getSqlStatementType(java.lang.String)
.
Value: 5
STATEMENT_DDL
static val STATEMENT_DDL: Int
One of the values returned by getSqlStatementType(java.lang.String)
.
Value: 8
STATEMENT_OTHER
static val STATEMENT_OTHER: Int
One of the values returned by getSqlStatementType(java.lang.String)
.
Value: 99
STATEMENT_PRAGMA
static val STATEMENT_PRAGMA: Int
One of the values returned by getSqlStatementType(java.lang.String)
.
Value: 7
STATEMENT_SELECT
static val STATEMENT_SELECT: Int
One of the values returned by getSqlStatementType(java.lang.String)
.
Value: 1
STATEMENT_UNPREPARED
static val STATEMENT_UNPREPARED: Int
One of the values returned by getSqlStatementType(java.lang.String)
.
Value: 9
STATEMENT_UPDATE
static val STATEMENT_UPDATE: Int
One of the values returned by getSqlStatementType(java.lang.String)
.
Value: 2
Public constructors
DatabaseUtils
DatabaseUtils()
Public methods
appendEscapedSQLString
open static fun appendEscapedSQLString(
sb: StringBuilder!,
sqlString: String!
): Unit
Appends an SQL string to the given StringBuilder, including the opening and closing single quotes. Any single quotes internal to sqlString will be escaped. This method is deprecated because we want to encourage everyone to use the "?" binding form. However, when implementing a ContentProvider, one may want to add WHERE clauses that were not provided by the caller. Since "?" is a positional form, using it in this case could break the caller because the indexes would be shifted to accomodate the ContentProvider's internal bindings. In that case, it may be necessary to construct a WHERE clause manually. This method is useful for those cases.
Parameters | |
---|---|
sb |
StringBuilder!: the StringBuilder that the SQL string will be appended to |
sqlString |
String!: the raw string to be appended, which may contain single quotes |
appendSelectionArgs
open static fun appendSelectionArgs(
originalValues: Array<String!>!,
newValues: Array<String!>!
): Array<String!>!
Appends one set of selection args to another. This is useful when adding a selection argument to a user provided set.
appendValueToSql
static fun appendValueToSql(
sql: StringBuilder!,
value: Any!
): Unit
Appends an Object to an SQL string with the proper escaping, etc.
bindObjectToProgram
open static fun bindObjectToProgram(
prog: SQLiteProgram!,
index: Int,
value: Any!
): Unit
Binds the given Object to the given SQLiteProgram using the proper typing. For example, bind numbers as longs/doubles, and everything else as a string by call toString() on it.
Parameters | |
---|---|
prog |
SQLiteProgram!: the program to bind the object to |
index |
Int: the 1-based index to bind at |
value |
Any!: the value to bind |
blobFileDescriptorForQuery
open static fun blobFileDescriptorForQuery(
db: SQLiteDatabase!,
query: String!,
selectionArgs: Array<String!>!
): ParcelFileDescriptor!
Utility method to run the query on the db and return the blob value in the first column of the first row.
Return | |
---|---|
ParcelFileDescriptor! |
A read-only file descriptor for a copy of the blob value. |
blobFileDescriptorForQuery
open static fun blobFileDescriptorForQuery(
prog: SQLiteStatement!,
selectionArgs: Array<String!>!
): ParcelFileDescriptor!
Utility method to run the pre-compiled query and return the blob value in the first column of the first row.
Return | |
---|---|
ParcelFileDescriptor! |
A read-only file descriptor for a copy of the blob value. |
concatenateWhere
open static fun concatenateWhere(
a: String!,
b: String!
): String!
Concatenates two SQL WHERE clauses, handling empty or null values.
createDbFromSqlStatements
open static fun createDbFromSqlStatements(
context: Context!,
dbName: String!,
dbVersion: Int,
sqlStatements: String!
): Unit
Creates a db and populates it with the sql statements in sqlStatements.
Parameters | |
---|---|
context |
Context!: the context to use to create the db |
dbName |
String!: the name of the db to create |
dbVersion |
Int: the version to set on the db |
sqlStatements |
String!: the statements to use to populate the db. This should be a single string of the form returned by sqlite3's .dump command (statements separated by semicolons) |
cursorDoubleToContentValues
open static fun cursorDoubleToContentValues(
cursor: Cursor!,
field: String!,
values: ContentValues!,
key: String!
): Unit
Reads a Double out of a field in a Cursor and writes it to a Map.
Parameters | |
---|---|
cursor |
Cursor!: The cursor to read from |
field |
String!: The REAL field to read |
values |
ContentValues!: The ContentValues to put the value into |
key |
String!: The key to store the value with in the map |
cursorDoubleToContentValuesIfPresent
open static fun cursorDoubleToContentValuesIfPresent(
cursor: Cursor!,
values: ContentValues!,
column: String!
): Unit
Reads a Double out of a column in a Cursor and writes it to a ContentValues. Adds nothing to the ContentValues if the column isn't present or if its value is null.
Parameters | |
---|---|
cursor |
Cursor!: The cursor to read from |
column |
String!: The column to read |
values |
ContentValues!: The ContentValues to put the value into |
cursorDoubleToCursorValues
open static fun cursorDoubleToCursorValues(
cursor: Cursor!,
field: String!,
values: ContentValues!
): Unit
Reads a Double out of a field in a Cursor and writes it to a Map.
Parameters | |
---|---|
cursor |
Cursor!: The cursor to read from |
field |
String!: The REAL field to read |
values |
ContentValues!: The ContentValues to put the value into |
cursorFloatToContentValuesIfPresent
open static fun cursorFloatToContentValuesIfPresent(
cursor: Cursor!,
values: ContentValues!,
column: String!
): Unit
Reads a Float out of a column in a Cursor and writes it to a ContentValues. Adds nothing to the ContentValues if the column isn't present or if its value is null.
Parameters | |
---|---|
cursor |
Cursor!: The cursor to read from |
column |
String!: The column to read |
values |
ContentValues!: The ContentValues to put the value into |
cursorIntToContentValues
open static fun cursorIntToContentValues(
cursor: Cursor!,
field: String!,
values: ContentValues!
): Unit
Reads an Integer out of a field in a Cursor and writes it to a Map.
Parameters | |
---|---|
cursor |
Cursor!: The cursor to read from |
field |
String!: The INTEGER field to read |
values |
ContentValues!: The ContentValues to put the value into, with the field as the key |
cursorIntToContentValues
open static fun cursorIntToContentValues(
cursor: Cursor!,
field: String!,
values: ContentValues!,
key: String!
): Unit
Reads a Integer out of a field in a Cursor and writes it to a Map.
Parameters | |
---|---|
cursor |
Cursor!: The cursor to read from |
field |
String!: The INTEGER field to read |
values |
ContentValues!: The ContentValues to put the value into, with the field as the key |
key |
String!: The key to store the value with in the map |
cursorIntToContentValuesIfPresent
open static fun cursorIntToContentValuesIfPresent(
cursor: Cursor!,
values: ContentValues!,
column: String!
): Unit
Reads a Integer out of a column in a Cursor and writes it to a ContentValues. Adds nothing to the ContentValues if the column isn't present or if its value is null.
Parameters | |
---|---|
cursor |
Cursor!: The cursor to read from |
column |
String!: The column to read |
values |
ContentValues!: The ContentValues to put the value into |
cursorLongToContentValues
open static fun cursorLongToContentValues(
cursor: Cursor!,
field: String!,
values: ContentValues!
): Unit
Reads a Long out of a field in a Cursor and writes it to a Map.
Parameters | |
---|---|
cursor |
Cursor!: The cursor to read from |
field |
String!: The INTEGER field to read |
values |
ContentValues!: The ContentValues to put the value into, with the field as the key |
cursorLongToContentValues
open static fun cursorLongToContentValues(
cursor: Cursor!,
field: String!,
values: ContentValues!,
key: String!
): Unit
Reads a Long out of a field in a Cursor and writes it to a Map.
Parameters | |
---|---|
cursor |
Cursor!: The cursor to read from |
field |
String!: The INTEGER field to read |
values |
ContentValues!: The ContentValues to put the value into |
key |
String!: The key to store the value with in the map |
cursorLongToContentValuesIfPresent
open static fun cursorLongToContentValuesIfPresent(
cursor: Cursor!,
values: ContentValues!,
column: String!
): Unit
Reads a Long out of a column in a Cursor and writes it to a ContentValues. Adds nothing to the ContentValues if the column isn't present or if its value is null.
Parameters | |
---|---|
cursor |
Cursor!: The cursor to read from |
column |
String!: The column to read |
values |
ContentValues!: The ContentValues to put the value into |
cursorRowToContentValues
open static fun cursorRowToContentValues(
cursor: Cursor!,
values: ContentValues!
): Unit
Read the entire contents of a cursor row and store them in a ContentValues.
Parameters | |
---|---|
cursor |
Cursor!: the cursor to read from. |
values |
ContentValues!: the ContentValues to put the row into. |
cursorShortToContentValuesIfPresent
open static fun cursorShortToContentValuesIfPresent(
cursor: Cursor!,
values: ContentValues!,
column: String!
): Unit
Reads a Short out of a column in a Cursor and writes it to a ContentValues. Adds nothing to the ContentValues if the column isn't present or if its value is null.
Parameters | |
---|---|
cursor |
Cursor!: The cursor to read from |
column |
String!: The column to read |
values |
ContentValues!: The ContentValues to put the value into |
cursorStringToContentValues
open static fun cursorStringToContentValues(
cursor: Cursor!,
field: String!,
values: ContentValues!
): Unit
Reads a String out of a field in a Cursor and writes it to a Map.
Parameters | |
---|---|
cursor |
Cursor!: The cursor to read from |
field |
String!: The TEXT field to read |
values |
ContentValues!: The ContentValues to put the value into, with the field as the key |
cursorStringToContentValues
open static fun cursorStringToContentValues(
cursor: Cursor!,
field: String!,
values: ContentValues!,
key: String!
): Unit
Reads a String out of a field in a Cursor and writes it to a Map.
Parameters | |
---|---|
cursor |
Cursor!: The cursor to read from |
field |
String!: The TEXT field to read |
values |
ContentValues!: The ContentValues to put the value into, with the field as the key |
key |
String!: The key to store the value with in the map |
cursorStringToContentValuesIfPresent
open static fun cursorStringToContentValuesIfPresent(
cursor: Cursor!,
values: ContentValues!,
column: String!
): Unit
Reads a String out of a column in a Cursor and writes it to a ContentValues. Adds nothing to the ContentValues if the column isn't present or if its value is null.
Parameters | |
---|---|
cursor |
Cursor!: The cursor to read from |
column |
String!: The column to read |
values |
ContentValues!: The ContentValues to put the value into |
cursorStringToInsertHelper
open static fun cursorStringToInsertHelper(
cursor: Cursor!,
field: String!,
inserter: DatabaseUtils.InsertHelper!,
index: Int
): Unit
Reads a String out of a field in a Cursor and writes it to an InsertHelper.
Parameters | |
---|---|
cursor |
Cursor!: The cursor to read from |
field |
String!: The TEXT field to read |
inserter |
DatabaseUtils.InsertHelper!: The InsertHelper to bind into |
index |
Int: the index of the bind entry in the InsertHelper |
dumpCurrentRow
open static fun dumpCurrentRow(cursor: Cursor!): Unit
Prints the contents of a Cursor's current row to System.out.
Parameters | |
---|---|
cursor |
Cursor!: the cursor to print from |
dumpCurrentRow
open static fun dumpCurrentRow(
cursor: Cursor!,
stream: PrintStream!
): Unit
Prints the contents of a Cursor's current row to a PrintSteam.
Parameters | |
---|---|
cursor |
Cursor!: the cursor to print |
stream |
PrintStream!: the stream to print to |
dumpCurrentRow
open static fun dumpCurrentRow(
cursor: Cursor!,
sb: StringBuilder!
): Unit
Prints the contents of a Cursor's current row to a StringBuilder.
Parameters | |
---|---|
cursor |
Cursor!: the cursor to print |
sb |
StringBuilder!: the StringBuilder to print to |
dumpCurrentRowToString
open static fun dumpCurrentRowToString(cursor: Cursor!): String!
Dump the contents of a Cursor's current row to a String.
Parameters | |
---|---|
cursor |
Cursor!: the cursor to print |
Return | |
---|---|
String! |
a String that contains the dumped cursor row |
dumpCursor
open static fun dumpCursor(cursor: Cursor!): Unit
Prints the contents of a Cursor to System.out. The position is restored after printing.
Parameters | |
---|---|
cursor |
Cursor!: the cursor to print |
dumpCursor
open static fun dumpCursor(
cursor: Cursor!,
stream: PrintStream!
): Unit
Prints the contents of a Cursor to a PrintSteam. The position is restored after printing.
Parameters | |
---|---|
cursor |
Cursor!: the cursor to print |
stream |
PrintStream!: the stream to print to |
dumpCursor
open static fun dumpCursor(
cursor: Cursor!,
sb: StringBuilder!
): Unit
Prints the contents of a Cursor to a StringBuilder. The position is restored after printing.
Parameters | |
---|---|
cursor |
Cursor!: the cursor to print |
sb |
StringBuilder!: the StringBuilder to print to |
dumpCursorToString
open static fun dumpCursorToString(cursor: Cursor!): String!
Prints the contents of a Cursor to a String. The position is restored after printing.
Parameters | |
---|---|
cursor |
Cursor!: the cursor to print |
Return | |
---|---|
String! |
a String that contains the dumped cursor |
getCollationKey
open static fun getCollationKey(name: String!): String!
return the collation key
Parameters | |
---|---|
name |
String!: |
Return | |
---|---|
String! |
the collation key |
getHexCollationKey
open static fun getHexCollationKey(name: String!): String!
return the collation key in hex format
Parameters | |
---|---|
name |
String!: |
Return | |
---|---|
String! |
the collation key in hex format |
getSqlStatementType
open static fun getSqlStatementType(sql: String!): Int
Returns one of the following which represent the type of the given SQL statement.
STATEMENT_SELECT
STATEMENT_UPDATE
STATEMENT_ATTACH
STATEMENT_BEGIN
STATEMENT_COMMIT
STATEMENT_ABORT
STATEMENT_PRAGMA
STATEMENT_DDL
STATEMENT_UNPREPARED
STATEMENT_OTHER
Parameters | |
---|---|
sql |
String!: the SQL statement whose type is returned by this method |
Return | |
---|---|
Int |
one of the values listed above |
longForQuery
open static fun longForQuery(
db: SQLiteDatabase!,
query: String!,
selectionArgs: Array<String!>!
): Long
Utility method to run the query on the db and return the value in the first column of the first row.
longForQuery
open static fun longForQuery(
prog: SQLiteStatement!,
selectionArgs: Array<String!>!
): Long
Utility method to run the pre-compiled query and return the value in the first column of the first row.
queryNumEntries
open static fun queryNumEntries(
db: SQLiteDatabase!,
table: String!
): Long
Query the table for the number of rows in the table.
Parameters | |
---|---|
db |
SQLiteDatabase!: the database the table is in |
table |
String!: the name of the table to query |
Return | |
---|---|
Long |
the number of rows in the table |
queryNumEntries
open static fun queryNumEntries(
db: SQLiteDatabase!,
table: String!,
selection: String!
): Long
Query the table for the number of rows in the table.
Parameters | |
---|---|
db |
SQLiteDatabase!: the database the table is in |
table |
String!: the name of the table to query |
selection |
String!: A filter declaring which rows to return, formatted as an SQL WHERE clause (excluding the WHERE itself). Passing null will count all rows for the given table |
Return | |
---|---|
Long |
the number of rows in the table filtered by the selection |
queryNumEntries
open static fun queryNumEntries(
db: SQLiteDatabase!,
table: String!,
selection: String!,
selectionArgs: Array<String!>!
): Long
Query the table for the number of rows in the table.
Parameters | |
---|---|
db |
SQLiteDatabase!: the database the table is in |
table |
String!: the name of the table to query |
selection |
String!: A filter declaring which rows to return, formatted as an SQL WHERE clause (excluding the WHERE itself). Passing null will count all rows for the given table |
selectionArgs |
Array<String!>!: You may include ?s in selection, which will be replaced by the values from selectionArgs, in order that they appear in the selection. The values will be bound as Strings. |
Return | |
---|---|
Long |
the number of rows in the table filtered by the selection |
readExceptionFromParcel
static fun readExceptionFromParcel(reply: Parcel!): Unit
Special function for reading an exception result from the header of a parcel, to be used after receiving the result of a transaction. This will throw the exception for you if it had been written to the Parcel, otherwise return and let you read the normal result data from the Parcel.
Parameters | |
---|---|
reply |
Parcel!: Parcel to read from |
See Also
readExceptionWithFileNotFoundExceptionFromParcel
open static fun readExceptionWithFileNotFoundExceptionFromParcel(reply: Parcel!): Unit
readExceptionWithOperationApplicationExceptionFromParcel
open static fun readExceptionWithOperationApplicationExceptionFromParcel(reply: Parcel!): Unit
sqlEscapeString
open static fun sqlEscapeString(value: String!): String!
SQL-escape a string.
stringForQuery
open static fun stringForQuery(
db: SQLiteDatabase!,
query: String!,
selectionArgs: Array<String!>!
): String!
Utility method to run the query on the db and return the value in the first column of the first row.
stringForQuery
open static fun stringForQuery(
prog: SQLiteStatement!,
selectionArgs: Array<String!>!
): String!
Utility method to run the pre-compiled query and return the value in the first column of the first row.
writeExceptionToParcel
static fun writeExceptionToParcel(
reply: Parcel!,
e: Exception!
): Unit
Special function for writing an exception result at the header of a parcel, to be used when returning an exception from a transaction. exception will be re-thrown by the function in another process
Parameters | |
---|---|
reply |
Parcel!: Parcel to write to |
e |
Exception!: The Exception to be written. |