How to import Room Persistence Library to an Android project

后端 未结 13 1241
执笔经年
执笔经年 2021-02-05 00:01

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

13条回答
  •  旧时难觅i
    2021-02-05 00:24

    It's possible to find the dependencies on the example codelab for the new architecture components.

    Root :

    allprojects {
    repositories {
        jcenter()
        maven {
            url "https://maven.google.com"
        }
    }
    

    For Room:

      implementation 'android.arch.persistence.room:runtime:1.0.0-alpha1'
      annotationProcessor 'android.arch.persistence.room:compiler:1.0.0-alpha1'
    

    For Lifecycle dependencies:

      implementation 'android.arch.lifecycle:extensions:1.0.0-alpha1'
      annotationProcessor 'android.arch.lifecycle:compiler:1.0.0-alpha1'
    

    Adding Rxjava2 objects as result for our queries:

      implementation 'android.arch.persistence.room:rxjava2:1.0.0-alpha1'
    

    Test migrations:

      testImplementation'android.arch.persistence.room:testing:1.0.0-alpha1'
    

提交回复
热议问题