public LoginDbHelper(@Nullable Context context, @Nullable String name, @Nullable SQLiteDatabase.CursorFactory factory, int version) {
super(context, name, factory, version);
}
@Override
public void onCreate(SQLiteDatabase db) {
String CREATE_TABLE_PLAYER="CREATE TABLE "+ Player.TABLE_NAME+"("
+Player.KEY_ID+" INTEGER PRIMARY KEY AUTOINCREMENT ,"
+Player.KEY_USER_NAME+" TEXT, "
+Player.KEY_USER_PASS+" TEXT );";
db.execSQL(CREATE_TABLE_PLAYER);
}
@Override
public void onUpgrade(SQLiteDatabase db, int i, int i1) {
db.execSQL("Drop table if exists " +
Player.TABLE_NAME+";");
onCreate(db);
}
|