In android is there any way to preserve SharedPreferences after an uninstall

后端 未结 8 1069
一生所求
一生所求 2020-12-01 07:54

I am keeping some application meta data in SharedPreferences. Whenever I uninstall the application and reinstall it, the SharedPreferences are dele

8条回答
  •  臣服心动
    2020-12-01 08:39

    One way to do this would be to store the user data on a server. Then when the user re-installs the app or installs the app on another device, they can "sync" their user data. That would just be a small HTTP download of the data, likely stored in JSON, which you would then parse and write into the SharedPreferences.

    If you don't want to maintain your own server, you could use a cloud service like Dropbox. This is how the app 1Password Reader works.

提交回复
热议问题