Does updating app clear sharedpreferences or remove alarms set by the app?

前端 未结 2 1018
广开言路
广开言路 2021-01-12 22:16

I\'ve published my app in google store and now I want to update it.

But I want to be assured that I don\'t lose stored data in my app shared preferences. I also set

相关标签:
2条回答
  • 2021-01-12 22:50

    SharedPreferences are stored and will survive updating the application. About the alarms I am not sure, sorry.

    For testing your update simply install your market version on your device, set up your stuff (alarms, sharedprefs) like a normal user would do and just install the apk on your phone that you would upload to the market (signed apk!). The installing should be the same as the update your user will get...

    0 讨论(0)
  • 2021-01-12 22:55

    Normally, the SharedPreferences(as well as other user data) will be kept during the update process, but sometimes, due to some "unknown" problem, the data may get lost, and I guess it is out of your control. So, you can simply believe that the SharedPreferences will be kept.

    As for alarms, how did you set these alarms? If you set them in code, it should be 100% ok as long as you set them right in code.

    Of course, the best way to test is install your updated app on your device before you push it up to the market. First, you should install your market version of app on your phone, then export your app with your market keystore on your local computer, finally, install the exported version on your phone(the installer should inform you about the update). And you can check if these settings are still there.

    While exporting, the most important thing is to make sure you are using the same keystore as you use with the market version of app.

    Hope this will help you.

    0 讨论(0)
提交回复
热议问题