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
open build.gradle(Project: projectName) and add this lines if it doesn't exist.
This enables access to google repository
allprojects {
repositories {
jcenter()
google()
}
}
next open build.gradle(Module:app) and add this two lines to existing dependencies
For Java
def room_version = "1.1.0"
implementation "android.arch.persistence.room:runtime:$room_version"
annotationProcessor "android.arch.persistence.room:compiler:$room_version"
For Kotlin
paste this line outside of the dependencies or android scope at the top where kotlin plugins are applied
apply plugin: 'kotlin-kapt'
add this lines to dependencies
def room_version = "1.1.0"
implementation "android.arch.persistence.room:runtime:$room_version"
kapt "android.arch.persistence.room:compiler:$room_version"
to keep yourself updated with the recent dependencies version visit mvn repository for room
here you will find the latest version.