mardi 27 janvier 2015

is SQLite db remain after application shutdown?

Very (very) basic question that unclear to me: Is SQLite db remain after application shutdown with all the data that was added to it or destroyed?


If so (and I hope so), when is the the DB schema created during the app lifecycle? I would expect it to be created on app installation, but according to the documentation I see this is done every time that the application started.


What am I missing? When is the code below executed during the application life cycle?



public class DatabaseHandler extends SQLiteOpenHelper {
// Creating Tables
@Override
public void onCreate(SQLiteDatabase db) {
String CREATE_CONTACTS_TABLE = "CREATE TABLE " + TABLE_CONTACTS + "("
+ KEY_ID + " INTEGER PRIMARY KEY," + KEY_NAME + " TEXT,"
+ KEY_PH_NO + " TEXT" + ")";
db.execSQL(CREATE_CONTACTS_TABLE);
}
} //DatabaseHandler

Aucun commentaire:

Enregistrer un commentaire