如何将Room Persistence Library导入Android项目 [英] How to import Room Persistence Library to an Android project

查看:77
本文介绍了如何将Room Persistence Library导入Android项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近在Google I/O Room Persistence Library上宣布了该新功能,该功能可与Android上的Sqlite数据库一起使用.我一直在寻找官方文档,但我找不到哪个依赖项,我应该将其导入到我的Android项目上的gradle文件中.有人可以帮我吗?

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 don't find which dependencies I should import to my gradle file on my Android project. Someone can give me a hand?

推荐答案

可以找到 根目录:

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

会议室:

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

对于生命周期依赖性:

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

添加Rxjava2对象作为查询的结果:

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

测试迁移:

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

这篇关于如何将Room Persistence Library导入Android项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆