简体   繁体   中英

Free and paid version sharedpreferences

Just a quick question... I've got a free and paid version of an app. The user data is stored using sharedpreferences. At the moment I am simply using the same package name in both versions so when the user upgrades it will read from the same sharedpreferences. It seems to be working fine at the moment, but I just don't know if it's ok to do it like that.

So basically just wanted to ask whether the above method I've used is fine, and do you predict there will be problems of data loss while upgrading doing it like this?

The user can easily delete SharedPreferences in application settings, also SharedPreferences are erased with all the other data in a uninstall.

The best way in your case would be to save a file on SD Card, which contains information about the state of the application.

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