user3034432
user3034432

Reputation: 33

Android Proper Place to Store User Info

After a user has logged in, I would like to keep the user data in a place that can be access by all activities, such as firstname, lastname, ID and the status that a user has logged in. Should I store them in a SharedPreferences or the class that extends Application? Or should I keep a SharedPreferences in the class that extends Application? I don't know which one is a good style.

Upvotes: 0

Views: 82

Answers (2)

Arun Anand
Arun Anand

Reputation: 11

Shared Preference is the Best Way to keep the logging status so that you can clear that on logout also.Keeping The shared preference in a class extends application is good so that you can use that statically around the app also try to store the keywords of sharedvalues in a seperate static class.

Upvotes: 1

Jorge
Jorge

Reputation: 1453

You can used SharedPreferences, that would make it available to for backup

Upvotes: 0

Related Questions