Posts

Showing posts with the label Android - Session Management Tutorial

Android - Session Management Tutorial

Image
Session help you when want to store user data outside your application, so that when the next time user use your application, you can easily get back his details and perform accordingly. This can be done in many ways. But the most easiest and nicest way of doing this is through  Shared Preferences . Shared Preferences Shared Preferences allow you to save and retrieve data in the form of key,value pair. In order to use shared preferences , you have to call a method getSharedPreferences() that returns a SharedPreference instance pointing to the file that contains the values of preferences. SharedPreferences sharedpreferences = getSharedPreferences ( MyPREFERENCES , Context . MODE_PRIVATE ); You can save something in the sharedpreferences by using SharedPreferences.Editor class. You will call the edit method of SharedPreference instance and will receive it in an editor object. Its syntax is − Editor editor = sharedpreferences . edit (); editor . putString ( "key...