Skip to content

Instantly share code, notes, and snippets.

@FisherKK
Created March 27, 2014 11:33
Show Gist options
  • Save FisherKK/9805589 to your computer and use it in GitHub Desktop.
Save FisherKK/9805589 to your computer and use it in GitHub Desktop.
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