public abstract class BackupDB
extends androidx.room.RoomDatabase
Modifier and Type | Field and Description |
---|---|
private static java.lang.String |
DATABASE_NAME |
private androidx.lifecycle.MutableLiveData<java.lang.Boolean> |
mIsDBCreated |
private static BackupDB |
sInstance |
private static java.lang.String |
TAG |
Constructor and Description |
---|
BackupDB() |
Modifier and Type | Method and Description |
---|---|
abstract BackupDao |
backupDao() |
private static BackupDB |
buildDatabase(android.app.Application app)
Build the database.
|
androidx.lifecycle.LiveData<java.lang.Boolean> |
getDatabaseCreated() |
static BackupDB |
INST(android.app.Application app) |
private void |
postDatabaseCreated() |
private void |
updateDatabaseCreated(android.content.Context context)
Check whether the database already exists and expose it via
getDatabaseCreated() |
assertNotMainThread, beginTransaction, clearAllTables, close, compileStatement, createInvalidationTracker, createOpenHelper, endTransaction, getInvalidationTracker, getOpenHelper, getQueryExecutor, init, internalInitInvalidationTracker, inTransaction, isOpen, query, query, runInTransaction, runInTransaction, setTransactionSuccessful
private static final java.lang.String TAG
private static final java.lang.String DATABASE_NAME
private static BackupDB sInstance
private final androidx.lifecycle.MutableLiveData<java.lang.Boolean> mIsDBCreated
public static BackupDB INST(android.app.Application app)
private static BackupDB buildDatabase(android.app.Application app)
Builder#build()
only sets up the database
configuration and creates a new instance of the database.
The SQLite database is only created when it's accessed for the first time.public abstract BackupDao backupDao()
private void updateDatabaseCreated(android.content.Context context)
getDatabaseCreated()
public androidx.lifecycle.LiveData<java.lang.Boolean> getDatabaseCreated()
private void postDatabaseCreated()