Skip to content

Instantly share code, notes, and snippets.

@Axxiss
Created May 4, 2012 09:38
Show Gist options
  • Save Axxiss/2593635 to your computer and use it in GitHub Desktop.
Save Axxiss/2593635 to your computer and use it in GitHub Desktop.
AcmeDatabaseHelper
private static class AcmeDatabaseHelper extends SQLiteOpenHelper {
private static final String CREATE_TABLE =
"create table "
+ TABLE_NAME + " ("
+ KEY_ID + " integer primary key autoincrement, "
+ KEY_FILENAME + " TEXT"
+ ");";
public LogDatabaseHelper(Context context) {
super(context, DB_NAME, null, DB_VERSION);
}
@Override
public void onCreate(SQLiteDatabase db) {
db.execSQL(CREATE_TABLE);
}
@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
db.execSQL("DROP TABLE IF EXISTS " + TABLE_NAME);
onCreate(db);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment