I really like this approach for handling sqlite database when developing for Android but I have a question when it comes to upgrading the database during an upgrade of the application. Is this method recommended or is it so much safer to do the standard procedure (as it seem to be) with drop table/create table/insert into, within a transaction instead, in order to being able to roll back in case of failure?
I really like this approach for handling sqlite database when developing for Android but
Share
Is there a particular method you’re talking about?
That link seems to show simple use of an
SQLiteOpenHelperwhich, as part of the standard API, I would say is recommended.You can do whatever you like in the
onUpgrademethod, whether it’sDROPping tables,ALTERing them, or whatever.If you want to wrap them in a transaction, that’s up to you.