oak
Class ObscuredSharedPreferences
java.lang.Object
oak.ObscuredSharedPreferences
- All Implemented Interfaces:
- android.content.SharedPreferences
public abstract class ObscuredSharedPreferences
- extends Object
- implements android.content.SharedPreferences
This code originally posted by Michael Burton on StackOverflow
http://stackoverflow.com/questions/785973/what-is-the-most-appropriate-way-to-store-user-settings-in-android-application/6393502#6393502
| Nested classes/interfaces inherited from interface android.content.SharedPreferences |
android.content.SharedPreferences.OnSharedPreferenceChangeListener |
|
Field Summary |
protected android.content.Context |
context
|
protected android.content.SharedPreferences |
delegate
|
protected static String |
UTF8
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface android.content.SharedPreferences |
getStringSet |
UTF8
protected static final String UTF8
- See Also:
- Constant Field Values
delegate
protected android.content.SharedPreferences delegate
context
protected android.content.Context context
ObscuredSharedPreferences
public ObscuredSharedPreferences(android.content.Context context,
android.content.SharedPreferences delegate)
getSpecialCode
protected abstract char[] getSpecialCode()
- Implement this method to supply your char array with your password
- Returns:
edit
public ObscuredSharedPreferences.Editor edit()
- Specified by:
edit in interface android.content.SharedPreferences
getAll
public Map<String,?> getAll()
- Specified by:
getAll in interface android.content.SharedPreferences
getBoolean
public boolean getBoolean(String key,
boolean defValue)
- Specified by:
getBoolean in interface android.content.SharedPreferences
getFloat
public float getFloat(String key,
float defValue)
- Specified by:
getFloat in interface android.content.SharedPreferences
getInt
public int getInt(String key,
int defValue)
- Specified by:
getInt in interface android.content.SharedPreferences
getLong
public long getLong(String key,
long defValue)
- Specified by:
getLong in interface android.content.SharedPreferences
getString
public String getString(String key,
String defValue)
- Specified by:
getString in interface android.content.SharedPreferences
contains
public boolean contains(String s)
- Specified by:
contains in interface android.content.SharedPreferences
registerOnSharedPreferenceChangeListener
public void registerOnSharedPreferenceChangeListener(android.content.SharedPreferences.OnSharedPreferenceChangeListener onSharedPreferenceChangeListener)
- Specified by:
registerOnSharedPreferenceChangeListener in interface android.content.SharedPreferences
unregisterOnSharedPreferenceChangeListener
public void unregisterOnSharedPreferenceChangeListener(android.content.SharedPreferences.OnSharedPreferenceChangeListener onSharedPreferenceChangeListener)
- Specified by:
unregisterOnSharedPreferenceChangeListener in interface android.content.SharedPreferences
encrypt
protected String encrypt(String value)
decrypt
protected String decrypt(String value)
Copyright © 2011-2014. All Rights Reserved.