I created a sqlite database (mydb.db) using sql browser then I created assets folder in the android application and added the mydb.db file on it.
how to connect to this database ? I use this code but it doesn't work properly with me any help please?
SQLiteDatabase db;
db = openOrCreateDatabase("DataBase.db",
SQLiteDatabase.CREATE_IF_NECESSARY, null);
Cursor c=db.rawQuery("SELECT * FROM user",null);
c.moveToFirst();
while(!c.isAfterLast())
{
Toast.makeText(this,c.getString(0)+ " "+c.getString(1),Toast.LENGTH_SHORT).show();
c.moveToNext();
}
db.close();
Aucun commentaire:
Enregistrer un commentaire