How to achieve the NSUserDefaults concept in Android

On the iPhone, we use NSUserDefaults to temporarily store data (about 30 images and texts) for a custom list. How can we achieve this in Android?

+4
source share
3 answers

Using the concept of sharedpreferences, you can achieve this.

see this link: SharedPreferences

and refer to this example: example for general settings

+4
source

SharedPreferences for texts, but for 30 images I would recommend using the folder in sdcard

SharedPreferences userPreference = getSharedPreferences("preference name", MODE_PRIVATE); 
+4
source

Use the SharedPreferences concept. It will contain prefs. a user similar to NSUserDefaults. Something like that:

 SharedPreferences sharedPreference = getSharedPreferences("Sample Preference", MODE_PRIVATE); 
+1
source

All Articles