Created
May 4, 2012 09:38
-
-
Save Axxiss/2593635 to your computer and use it in GitHub Desktop.
AcmeDatabaseHelper
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
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