how to upgrade the prevoius apk with new apk without losing the previous data in android from unknown resources apk

非 Y 不嫁゛ 提交于 2019-12-10 13:07:09

问题


How to upgrade the android application with out losing previous apk data in real device with new apk ?


回答1:


there is a versionCode element in AndroidManifest.xml. This is an integer and its value should be increased for each new version. So the higher the value of this integer, the more recent the version of your app is. So to update your app with apk, you should just increment this number by 1 and recompile your app and use the resulting apk to install your app as you normally would. The data will be automatically saved. This is how hockeyapp updates the app for beta testers.




回答2:


This is the default behaviour. You will need to to implement special logic if you need to REMOVE the data. Just reinstall the apk.




回答3:


Try to see if your data are stored in your SD card and copy the containing folder on your computer. But I guess if your data are stored on your SD card, the new apk will try to read it before recreating everything and delete everything. If your data are stored elsewhere, just backup these data.

I don't think updating an apk will destroy your data. One only thing to know when it's risky : Backup on your computer. Hope it will help.



来源:https://stackoverflow.com/questions/10332116/how-to-upgrade-the-prevoius-apk-with-new-apk-without-losing-the-previous-data-in

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