美文网首页
greendao的引入<1>

greendao的引入<1>

作者: 天空在微笑 | 来源:发表于2017-11-21 21:52 被阅读1次

https://github.com/greenrobot/greenDAO
greenDAO官网

GreenDao 优点:

1.性能高,号称Android最快的关系型数据库
2.内存占用小
3.库文件比较小,小于100K,编译时间低,而且可以避免65K方法限制
4.支持数据库加密 greendao支持SQLCipher进行数据库加密 有关SQLCipher可以参考这篇博客Android数据存储之Sqlite采用SQLCipher数据库加密实战
5.简洁易用的API

  1. 在project的gradle中添加
// In your root build.gradle file:
buildscript {
    repositories {
        jcenter()
        mavenCentral() // add repository
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.3.3'
        classpath 'org.greenrobot:greendao-gradle-plugin:3.2.2' // add plugin
    }
}
  1. 在app module的gradle中加入
// In your app projects build.gradle file:
apply plugin: 'com.android.application'
apply plugin: 'org.greenrobot.greendao' // apply plugin
 
dependencies {
    compile 'org.greenrobot:greendao:3.2.2' // add library
}
  1. 加入依赖
dependencies {
    compile 'org.greenrobot:greendao:3.2.2' // 当前最新版本
}
  1. 添加数据库属性
    在app module 的gradle的android节点添加如下:
greendao{
        schemaVersion  1            //--> 指定数据库schema版本号,迁移等操作会用到;
        daoPackage   'sysshare.lq.com.greendaotest.gen' //--> dao的包名,包名默认是entity所在的包;
        targetGenDir 'src/main/java'//--> 生成数据库文件的目录;
    }

相关文章

  • greendao的引入<1>

    https://github.com/greenrobot/greenDAOgreenDAO官网 GreenDao...

  • GreenDao的简单实用总结

    GreenDao使用步骤1 引入GreenDao先在project的build.gradle中引入GreenDao...

  • <1>

    2018.5 首都机场 夜晚的首都也是那么彻夜通明,没有白天黑夜之分,机场更是人来人往,行色匆匆,接打电话专注自己...

  • GreenDao3 使用入门笔记

    第一步 GreenDao插件引入 首先在工程的build.gradle文件中配置GreenDao插件 然后在使用模...

  • GreenDao集成使用

    1、在项目中引入greendao,配置如下 dependencies { implementation fil...

  • GreenDao3.0简单使用

    1.引入greenDao app的gradle配置 applyplugin:'com.android.applic...

  • ★35.GreenDao

    导入GreenDAO 1. 引入依赖 按照 GitHub 上的说明引入依赖。 2. 设置路径 在build.gra...

  • Android从零搭建项目01 -BaseActivity

    依赖引入 greendao butterknife的引入还需再项目的gradle加入 1 设置沉浸式状态栏 在ba...

  • 星河<1>

    街边高大的梧桐,舒展开嫩绿的手掌。阳光欢快地跳过,轻轻着陆。在这样的日子里…… “啊啊啊啊!” 高中开...

  • 写给小白——greenDao引入项目

    本篇文章,不讲greenDao的好处,也不讲如何使用,因为这些在网上,到处都有,就不再去讲了。但是,本人,在git...

网友评论

      本文标题:greendao的引入<1>

      本文链接:https://www.haomeiwen.com/subject/plrmpxtx.html