简体   繁体   中英

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

如何使用新的apk在真实设备中丢失之前的apk数据来升级Android应用程序?

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.

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM