mardi 14 juillet 2015

Downloading sqlite3 file conflict ANDROID

I'm developing an android app that has a sqlite3 database file. The app has the ability to download an updated version of the database from the server. However after I update the file, when I'm trying to access to the database with a class that extends from SQLiteOpenHelper it always tries to re-create the databases (Entering in onCreate's helper method). But, as it already exists, it throws an error: "TABLE_XXX" already exists.

This only happens when I download the database from a server. I've solved it for now by checking if there is already a file in the databases directory of my application, but this is not ideal.

Aucun commentaire:

Enregistrer un commentaire