0

I want to save an int and a boolean in my android-app. At the moment I use sharedPreferences to save the variables. What happens if I update my app or reinstall it?

Should I better use a database for saving the variables?

Howli
  • 11,925
  • 19
  • 46
  • 70
basti12354
  • 2,338
  • 4
  • 23
  • 39

1 Answers1

0

The SharedPreferences will get deleted. But if you use a BackupAgentHelper (more information here), you could back up your preferences to the cloud.

If you want to do it without internet access, you could save your data to the sd-card.

Community
  • 1
  • 1
Manuel Allenspach
  • 12,002
  • 13
  • 52
  • 74