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
  • 12,291
  • 19
  • 47
  • 72
basti12354
  • 2,490
  • 4
  • 24
  • 43

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,467
  • 14
  • 54
  • 76