In this Android Video Tutorial, I have explained The Shared Preference.
You’re going to experience the power of Shared Preference in action and learn:
- The purpose of a Shared Preference
- The components that make up a Shared Preference
One of the best way to save data in your android app is by making use of SharedPreference.
In this video, I have explained all the modes that can be used in SharedPreference.
To save data using SharedPreference we can use the syntax below:-
Editor editor = sharedpreferences.edit();
editor.putString("key", "value");
editor.commit();
on the other hand, to retrieve the data saved in sharedpreference we will be using:-
getString("key", "default value");
In this tutorial, I have also shown the working example of shared preference that tell's you exactly how the sharedpreference works
0 Comment(s)