July 27,2016
Android shared preference is used to store and retrieve primitive information. In android, string, integer, long, number etc. are considered as primitive data type.
Android Shared preferences are used to store data in key and value pair so that we can retrieve the value on the basis of key.
It is widely used to get information from user such as in settings.
Android Preferences Example
Let’s see a simple example of android shared preference.
