9

I don't want to let Settings clear my app sharedPreference by anyone: is it possible?

braX
  • 11,506
  • 5
  • 20
  • 33
Hardik
  • 17,179
  • 2
  • 35
  • 40

2 Answers2

3

I found this similar question:

Shared preferences and files not saved to the SD card will be deleted when the app is uninstalled.

Files saved to the SD card will persists after uninstall, however, the user will have access to read, over-write, and delete these files at will.

If you need truly permanent storage the best way forward would be to store the data remotely on a server that you control.

If you don't care about data, then you can save it on SD Card.

EDIT

I think that BFil answer's is very good on this post, check it.

My final verdict

After long research (for my pure and insane curiosity!), there is no way (at the moment?) to preserve SharedPreference after clear on Settings: the only way is a server vault or Data Backup.

Community
  • 1
  • 1
JJ86
  • 5,055
  • 2
  • 35
  • 64
  • i found a way to prevent data being cleared from shared preference...See My Answer ::))) –  Jan 31 '14 at 08:05
0

add this tag in manifesto allowClearUserData=false. this code verified.

deepan
  • 124
  • 1
  • 4