public final class

SupportSQLiteCompat.Api16Impl

extends java.lang.Object

 java.lang.Object

↳androidx.sqlite.db.SupportSQLiteCompat.Api16Impl

Overview

Class for accessing functions that require SDK version 16 and higher.

Summary

Methods
public static voidcancel(CancellationSignal cancellationSignal)

Cancels the operation and signals the cancellation listener.

public static CancellationSignalcreateCancellationSignal()

Creates a cancellation signal, initially not canceled.

public static booleandeleteDatabase(java.io.File file)

Deletes a database including its journal file and other auxiliary files that may have been created by the database engine.

public static voiddisableWriteAheadLogging(SQLiteDatabase sQLiteDatabase)

This method disables the features enabled by SQLiteDatabase.

public static booleanisWriteAheadLoggingEnabled(SQLiteDatabase sQLiteDatabase)

Returns true if write-ahead logging has been enabled for this database.

public static CursorrawQueryWithFactory(SQLiteDatabase sQLiteDatabase, java.lang.String sql, java.lang.String selectionArgs[], java.lang.String editTable, CancellationSignal cancellationSignal, SQLiteDatabase.CursorFactory cursorFactory)

Runs the provided SQL and returns a cursor over the result set.

public static voidsetForeignKeyConstraintsEnabled(SQLiteDatabase sQLiteDatabase, boolean enable)

Sets whether foreign key constraints are enabled for the database.

public static voidsetWriteAheadLoggingEnabled(SQLiteOpenHelper sQLiteOpenHelper, boolean enabled)

Sets SQLiteDatabase flag if enabled is true, unsets otherwise.

from java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Methods

public static void cancel(CancellationSignal cancellationSignal)

Cancels the operation and signals the cancellation listener. If the operation has not yet started, then it will be canceled as soon as it does.

public static CancellationSignal createCancellationSignal()

Creates a cancellation signal, initially not canceled.

Returns:

a new cancellation signal

public static boolean deleteDatabase(java.io.File file)

Deletes a database including its journal file and other auxiliary files that may have been created by the database engine.

Parameters:

file: The database file path.

Returns:

True if the database was successfully deleted.

public static Cursor rawQueryWithFactory(SQLiteDatabase sQLiteDatabase, java.lang.String sql, java.lang.String selectionArgs[], java.lang.String editTable, CancellationSignal cancellationSignal, SQLiteDatabase.CursorFactory cursorFactory)

Runs the provided SQL and returns a cursor over the result set.

Parameters:

sql: the SQL query. The SQL string must not be ; terminated
selectionArgs: You may include ?s in where clause in the query, which will be replaced by the values from selectionArgs. The values will be bound as Strings.
editTable: the name of the first table, which is editable
cancellationSignal: A signal to cancel the operation in progress, or null if none. If the operation is canceled, then will be thrown when the query is executed.
cursorFactory: the cursor factory to use, or null for the default factory

Returns:

A object, which is positioned before the first entry. Note that s are not synchronized, see the documentation for more details.

public static void setForeignKeyConstraintsEnabled(SQLiteDatabase sQLiteDatabase, boolean enable)

Sets whether foreign key constraints are enabled for the database.

Parameters:

enable: True to enable foreign key constraints, false to disable them.

public static void disableWriteAheadLogging(SQLiteDatabase sQLiteDatabase)

This method disables the features enabled by SQLiteDatabase.

See also: SQLiteDatabase

public static boolean isWriteAheadLoggingEnabled(SQLiteDatabase sQLiteDatabase)

Returns true if write-ahead logging has been enabled for this database.

Returns:

True if write-ahead logging has been enabled for this database.

See also: SQLiteDatabase, SQLiteDatabase

public static void setWriteAheadLoggingEnabled(SQLiteOpenHelper sQLiteOpenHelper, boolean enabled)

Sets SQLiteDatabase flag if enabled is true, unsets otherwise.