How to import Room Persistence Library to an Android project

后端 未结 13 1232
执笔经年
执笔经年 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条回答
  •  花落未央
    2021-02-05 00:23

    As of July 2019 if you wish to use Room with Kotlin, AndroidX, Coroutines or RxJava add lines below.

       // Room
        implementation 'androidx.room:room-runtime:' + rootProject.roomVersion
        // For Kotlin use kapt instead of annotationProcessor
        kapt 'androidx.room:room-compiler:' + rootProject.roomVersion
        // optional - Kotlin Extensions and Coroutines support for Room
        implementation 'androidx.room:room-ktx:' + rootProject.roomVersion
        // optional - RxJava support for Room
        implementation 'androidx.room:room-rxjava2:' + rootProject.roomVersion
    

提交回复
热议问题