Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Are the shared preferences associated with the App deleted when the app is removed?

Are SharedPreferences value for an App retained even after it is removed?

If not, I would like to retain the SharedPreferences even after the app is uninstalled/removed. Is there a way?

Edit: I am reluctant to store the settings on the SD Card. Is there a way I can store them in the phone memory itself?

like image 773
Arnab Chakraborty Avatar asked Jan 20 '23 02:01

Arnab Chakraborty


1 Answers

SharedPreferences are deleted when an app is uninstalled, but you can use the BackupManager to perform a backup into the cloud - Reto Meier has a good blog post for getting you started.

This approach means if a user installs you app onto a new phone they can have their preferences copied over to there as well.

like image 142
Steve Bosman Avatar answered Feb 05 '23 10:02

Steve Bosman