Android Dev Summit, October 23-24: two days of technical content, directly from the Android team. Sign-up for livestream updates.

androidx.core.database

Classes

CursorWindowCompat

Helper for accessing features in android.database.CursorWindow

DatabaseUtilsCompat

Helper for accessing features in android.database.DatabaseUtils.

Extension functions summary

For android.database.Cursor
ByteArray?

Returns the value of the requested column as a nullable byte array.

Double?

Returns the value of the requested column as a nullable double.

Float?

Returns the value of the requested column as a nullable float.

Int?

Returns the value of the requested column as a nullable integer.

Long?

Returns the value of the requested column as a nullable long.

Short?

Returns the value of the requested column as a nullable short.

String?

Returns the value of the requested column as a nullable string.

Extension functions

getBlobOrNull

inline fun Cursor.getBlobOrNull(index: Int): ByteArray?

Returns the value of the requested column as a nullable byte array.

The result and whether this method throws an exception when the column type is not a blob type is implementation-defined.

getDoubleOrNull

inline fun Cursor.getDoubleOrNull(index: Int): Double?

Returns the value of the requested column as a nullable double.

The result and whether this method throws an exception when the column type is not a floating-point type is implementation-defined.

getFloatOrNull

inline fun Cursor.getFloatOrNull(index: Int): Float?

Returns the value of the requested column as a nullable float.

The result and whether this method throws an exception when the column type is not a floating-point type is implementation-defined.

getIntOrNull

inline fun Cursor.getIntOrNull(index: Int): Int?

Returns the value of the requested column as a nullable integer.

The result and whether this method throws an exception when the column type is not an integral type is implementation-defined.

getLongOrNull

inline fun Cursor.getLongOrNull(index: Int): Long?

Returns the value of the requested column as a nullable long.

The result and whether this method throws an exception when the column type is not an integral type is implementation-defined.

getShortOrNull

inline fun Cursor.getShortOrNull(index: Int): Short?

Returns the value of the requested column as a nullable short.

The result and whether this method throws an exception when the column type is not an integral type is implementation-defined.

getStringOrNull

inline fun Cursor.getStringOrNull(index: Int): String?

Returns the value of the requested column as a nullable string.

The result and whether this method throws an exception when the column type is not a string type is implementation-defined.