Back to project page Note.
The source code is released under:
MIT License
If you think the Android project Note listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package org.bq.app; //from ww w . j av a 2 s .c o m import org.bq.db.DaoMaster; import org.bq.db.DaoSession; import android.app.Application; import android.content.Context; import android.database.sqlite.SQLiteDatabase; public class NoteApplication extends Application { public static Context applicationContext; private static NoteApplication instance; /** * ?????greenDao????????????? */ public static DaoSession daoSession; private static SQLiteDatabase database; @Override public void onCreate() { super.onCreate(); applicationContext = this; instance = this; database = new DaoMaster.DevOpenHelper(this, "notes-db", null) .getWritableDatabase(); DaoMaster daoMaster = new DaoMaster(database); daoSession = daoMaster.newSession(); } public static NoteApplication getInstance() { return instance; } public static SQLiteDatabase getDB() { return database; } }