地址:https://github.com/greenrobot/greenDAO
1.集成
// In your root build.gradle file:
buildscript {
repositories {
jcenter()
mavenCentral() // add repository
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.1'
classpath 'org.greenrobot:greendao-gradle-plugin:3.2.2' // add plugin
}
}
// In your app projects build.gradle file:
apply plugin: 'com.android.application'
apply plugin: 'org.greenrobot.greendao' // apply plugin
dependencies {
implementation 'org.greenrobot:greendao:3.2.2' // add library
}
- modelling-entities 参考:http://greenrobot.org/greendao/documentation/modelling-entities/
- Build > Make Project 编译生成代码
- Core Initialization 参考:http://greenrobot.org/greendao/documentation/introduction/
网友评论