Created
February 13, 2017 10:46
-
-
Save janishar/c9df766505ade199b45e2d824af88ec5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class DemoApp extends Application { | |
private DaoSession mDaoSession; | |
@Override | |
public void onCreate() { | |
super.onCreate(); | |
mDaoSession = new DaoMaster( | |
new DaoMaster.DevOpenHelper(this, "greendao_demo.db").getWritableDb()).newSession(); | |
// USER CREATION FOR DEMO PURPOSE | |
if(mDaoSession.getUserDao().loadAll().size() == 0){ | |
mDaoSession.getUserDao().insert(new User(1L, "Janishar Ali","", "")); | |
} | |
} | |
public DaoSession getDaoSession() { | |
return mDaoSession; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment