What happens to my Android app and database when a user updates through Market Place?

ぃ、小莉子 提交于 2019-12-23 04:16:32

问题


Ok, I currently have an app on the MarketPlace and today I release its first update. Will the SQLite database used by my app be overwritten by the update, thus calling the onCreate once again? Or will it simply not touch the database? What happens to the SharedPreferences?

Sorry for the seemingly simple questions, I've been googling for an hour now and haven't found anything on what happens to a package when the user updates the app. Does it totally wiped out and reinstalled? Dunno. Any help will be highly appreciated. Thank you!


回答1:


if you are using sqlite inside your db adapter, it will check for this variable:

private static final int DATABASE_VERSION;

If it's different than the one installed in user's device, it will attempt to call the overridden onUpgrade() method of sqlite.



来源:https://stackoverflow.com/questions/4295423/what-happens-to-my-android-app-and-database-when-a-user-updates-through-market-p

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