I recently saw the new feature announced on Google I/O Room Persistence Library to work with Sqlite databases on Android. I have been looking to the official documentation and I
Android doc:
Add the Google Maven repository Android Studio projects aren't configured to access this repository by default.
To add it to your project, open the build.gradle file for your project (not the ones for your app or module) and add the highlighted line as shown below:
allprojects {
repositories {
jcenter()
maven { url 'https://maven.google.com' }
}
}
Add Architecture Components
Open the build.gradle file for your app or module and add the artifacts that you need as dependencies:
For Lifecycles, LiveData, and ViewModel, add:
implementation "android.arch.lifecycle:runtime:1.0.0-alpha1"
implementation "android.arch.lifecycle:extensions:1.0.0-alpha1"
annotationProcessor "android.arch.lifecycle:compiler:1.0.0-alpha1"
For Room, add:
implementation "android.arch.persistence.room:runtime:1.0.0-alpha1"
annotationProcessor "android.arch.persistence.room:compiler:1.0.0-alpha1"