androidschemaactiveandroid

How to delete and recreate a database in Android?


we have an application that uses ActiveAndroid ORM, in some devices like Vivo and some models of Samsung, the schema doesn't get updated even if you increase the version of the database, more problematic is the Vivo models doesn't seem to delete the old database even if you clear data or uninstall the app.

tried using shared preference to hold the value of the database version and if it doesn't match deletes it using context.deleteDatabase("mydatabase.db"), however, it gives SQLiteDiskIOException: disk I/O error (code 1802)

im looking for another way so that i can force it update or recreate the database schema


Solution

  • found what is missing in our app, it requires a separate script for updating the schema

    https://github.com/pardom/ActiveAndroid/wiki/Schema-migrations