Top "Sharedpreferences" questions

SharedPreferences allows you to save and retrieve persistent key-value pairs of primitive data types in Android applications.

Check if key exists in Shared Preferences

I'm creating Shared Preferences as follows preferences = getSharedPreferences("text", 0); final Editor editor = preferences.edit(); String s1 = serverIP.getText().toString(); String …

android sharedpreferences
Android getDefaultSharedPreferences

My code is: final String eulaKey = "mykey"; final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext()); boolean hasBeenShown = prefs.getBoolean(eulaKey, false); Always …

android sharedpreferences
How to listen for preference changes within a PreferenceFragment?

As described here, I am subclassing PreferenceFragment and displaying it inside an Activity. That document explains how to listen for …

android android-fragments android-activity sharedpreferences android-preferences
Android login/registration with shared preferences

I'm new to Android. I'm doing an app for an university exam. I have to do an application for a …

android session login sharedpreferences user-registration
Pros and Cons of SQLite and Shared Preferences

What is the good mechanism to store information among SQLite database and Shared Preferences? Why use shared preferences? Why use …

android database sqlite sharedpreferences data-storage
Android SharedPreferences , how to save a simple int variable

I am trying for the last hour to save an integer in my Android application. I read that this can …

android sharedpreferences
How to save List<Object> to SharedPreferences?

I have a list of products, which i retrieve from webservice, when app is opened for first time, app gets …

java android sharedpreferences
iOS Equivalent For Android Shared Preferences

I am porting an Android app to iOS, one thing I used was the Shared Preferences in Android to save …

ios sharedpreferences
How to check if SharedPreferences exists or not

I'm checking in this way if the file exists, but I need to go beyond, I need to know if …

android sharedpreferences
How to Secure Android Shared Preferences?

The common location where SharedPreferences are stored in Android apps is: /data/data/<package name>/shared_prefs/<…

android security encryption sharedpreferences