Created
March 27, 2014 11:33
-
-
Save FisherKK/9805589 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 DaoExampleApplication extends Application { | |
public DaoSession daoSession; | |
@Override | |
public void onCreate() { | |
super.onCreate(); | |
setupDatabase(); | |
} | |
private void setupDatabase() { | |
DaoMaster.DevOpenHelper helper = new DaoMaster.DevOpenHelper(this, "example-db", null); | |
SQLiteDatabase db = helper.getWritableDatabase(); | |
DaoMaster daoMaster = new DaoMaster(db); | |
daoSession = daoMaster.newSession(); | |
} | |
public DaoSession getDaoSession() { | |
return daoSession; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment