Kurt
Kurt

Reputation: 777

Persistency of shared preferences

I have a game that uses a shared preference to record the users high score and display this on a statistics page.

My question -> Will this shared preference persist even after the user exits the application? How do I ensure that this data is always retained, will shared preferences do this or do I need to use something else?

Upvotes: 1

Views: 106

Answers (3)

Dipak Keshariya
Dipak Keshariya

Reputation: 22291

Please see below link for complete infomation of shared preferences, it will solve your problem.

Android Shared Preferences

Upvotes: 0

iagreen
iagreen

Reputation: 32016

Yes, shared preferences are stored until the app is uninstalled or the user clears app data.

See storage options for details on different methods of persisting data.

Upvotes: 0

mbelsky
mbelsky

Reputation: 6578

Will this shared preference persist even after the user exits the application?

yes!

How do I ensure that this data is always retained, will shared preferences do this or do I need to use something else?

See documentation

Upvotes: 2

Related Questions