4

I am making an Android app, and I will do some process at the first launch of the app.After the first launch I will not these process again. So, for doing this, I want to use SharedPrefences. How long does it save data? When and how does its saved datas remove?

Be Studios
  • 49
  • 4

3 Answers3

5

Data in SharedPrefences is saved until the user uninstalls the app, or clears the app cache

2

Data in SharedPrefences is saved as file in your app internal storage, its be removed in case:

  • unInstall app

  • clear you app data

  • call yourSharedPreferences.edit().clear().apply()

hope this helps

GianhTran
  • 3,443
  • 2
  • 22
  • 42
-1

When you clear the cash memory form settings all the information will be deleted and start fully new. so it not exactly that you need to uninstall your app.

So sharedpreferences is basically store data in primitive way which mean it doesn't contain data directly instead it's reference.

Hamza Rahman
  • 664
  • 7
  • 19