Working with a SQLite database
SQLite is a popular relational database management system (RDBMS) that, unlike many RDBMS systems, is not a client-server database engine. Instead, a SQLite database is embedded directly into an application.
Android provides full support for SQLite. SQLite databases are accessible throughout an Android project by classes. Note that in Android, a database is only accessible to the application that created it.
The use of the Room persistence library is the recommended method of working with SQLite in Android. The first step to work with room
in Android is the inclusion of its necessary dependencies in a project's build.gradle
script:
implementation "android.arch.persistence.room:runtime:1.0.0-alpha9-1" implementation "android.arch.persistence.room:rxjava2:1.0.0-alpha9-1" implementation "io.reactivex.rxjava2:rxandroid:2.0.1" kapt "android.arch.persistence.room:compiler:1.0.0-alpha9-1"
Entities can easily be created with the help of Room
. All entities must be annotated...