Describe SharedPreference storage option with example.
Answer / shubhraneel
If we talk about Android, then there are many ways in which it stores data of application. One way is by 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.
example: SharedPreferences sharedpreferences = getSharedPreferences(MyPREFERENCES, Context.MODE_PRIVATE);
In the above example The first parameter is the key and the second parameter is the MODE
| Is This Answer Correct ? | 1 Yes | 0 No |
When you need to use mp3 file in android application, which folder you need to create and store mp3 file?
What is logging (logcat)?
When will it be available in a ROM?
What is proguard-rules.pro?
What is the difference between a class , a file and an activity in android?
Can exe file run on android?
In android, normally sdcard is?
Explain me what is the android application architecture?
What is a service?
What is the difference between android system and android os?
What is the latest version of android?
Which kernel is used in android?