Automatically uninstalling the older app before installing the new one

你离开我真会死。 提交于 2019-12-24 10:29:54

问题


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)



来源:https://stackoverflow.com/questions/52704991/automatically-uninstalling-the-older-app-before-installing-the-new-one

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!