I am developing an Android app that needs to receive specific informations for each user.
I made an authentication using GET and POST methods. Now I have the cookie delivered by the server when the username and password are correct.
How do I store this data? I looked for but couldn’t find the best way to store a session in Android.
How applications like Foursquare, Facebook for example keep the state of an user? How do they persist data?
If you just want to store some user info, you can use SharedPreferences as long as you can get the text from the server.
Once you have the text you want to save:
Once you copy the info from the server to the SharedPreferences, you can access it like so: