Android SharedPreferences


Preferences are generly a little storage and typically name value pairs. They can be stored as “Shared Preferences” across various activities in an application. Or it can be something that needs to be stored specific to an activity.Here you will see the useage of SharedPreferences.

Let we use SharedPreferences as storage of login info i.e username and password.

We store date like below.

We will get data from shared preferences using following method.

Try it very easy and simple technique.