Skip to content

Instantly share code, notes, and snippets.

@msdalp
Created March 1, 2014 19:47
Show Gist options
  • Save msdalp/9296041 to your computer and use it in GitHub Desktop.
Save msdalp/9296041 to your computer and use it in GitHub Desktop.
public class MyDb extends SQLiteOpenHelper {
public static final String TAG = "MyDb";
public static final int VERSION = 1;
public static final String DATABASENAME = "mydb";
public MyDb(Context context) {
super(context, DATABASENAME, null, VERSION);
}
@Override
public void onCreate(SQLiteDatabase db) {
db.execSQL("CREATE TABLE IF NOT EXISTS data" +
+ " (ID INTEGER PRIMARY KEY, "
+ "DATA_ID TEXT, "
+ "VALUE TEXT);");
}
@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment