How to import Room Persistence Library to an Android project

后端 未结 13 1194
执笔经年
执笔经年 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:12

    def room_version = "2.2.3"
    def lifecycle_version = "2.1.0"
    
    implementation "androidx.room:room-runtime:$room_version"
    annotationProcessor "androidx.room:room-compiler:$room_version"
    
    implementation "androidx.lifecycle:lifecycle-extensions:$lifecycle_version"   // ViewModel and LiveData
    annotationProcessor "androidx.lifecycle:lifecycle-compiler:$lifecycle_version"
    

提交回复
热议问题