I published my app on play store and I have made an update that may cause the older one to crash due to some database structure changes that I have made and I have had a hell of hustle trying to automate DB migration upon installation. So I want the to completely auto-uninstall the old one from users phone before new one is installed during update as an easy solution. Is there a way I can include such configurations?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
No, there is no way to force uninstallation before installation. But it sounds like you could just delete your DB on upgrade using SQLiteOpenHelper
回答2:
If you use GreenDAO you can use the schema version Schema schema = new Schema(, "greendao");
when increasing the schema version GreenDAO will empty your DB and update the schema, and then you can repopulate it from the server (if applicable)