Basic usage of greenDao (1)

1. Configuration

 

1.1 In build.gradle (project), add this sentence

 

classpath 'org.greenrobot:greendao-gradle-plugin:3.2.2' // add plugin

  

as the picture shows

 

 

1.2 In build.gradle (app), add this sentence in dependencies {}

 

compile 'org.greenrobot:greendao:3.2.2'

 

Add this sentence in android {}

 

greendao { 
    schemaVersion 1 // Database version number 
    daoPackage 'com.xxx.database' // You want to store the package name of 
    greendao related files targetGenDir 'src / main / java' // Set the generated DaoMaster, DaoSession, Dao path 
}

 

Then add this sentence at the top

 

apply plugin: 'org.greenrobot.greendao'

 

sync, configuration is complete

Guess you like

Origin www.cnblogs.com/qq1094417747/p/12711795.html
Recommended