Reputation: 13
I'm currently coding an android application. To read a pre-existing database, I use the SQLiteAssethelper
. It works all fine but can anyone tell me how I can insert data with the SQLiteAssethelper
? Thank you!
Upvotes: 0
Views: 396
Reputation: 403
Try this:
SQLiteDatabase mDb=getWritableDatabase();
ContentValues values = new ContentValues();
values.put("column_1", "value_1");
values.put("column_2", "value_2");
long insert_result = mDb.insert(dbSchema.table_name, null, values);
mDb.close();
Upvotes: 1