public class P
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
vera
Default value of the String preference
Use this variable to check if the key doesn't have a value
|
| Constructor and Description |
|---|
P() |
| Modifier and Type | Method and Description |
|---|---|
static java.util.Map<java.lang.String,?> |
getAll(android.content.Context context)
Gets all the preferences
NOTE: Do not change the values of the to have the saved content to be consistent
|
static java.util.Map<java.lang.String,?> |
getAll(android.content.Context context,
java.lang.String prefName)
Gets all the preferences
NOTE: Do not change the values of the to have the saved content to be consistent
|
static boolean |
getBoolean(android.content.Context context,
java.lang.String key)
Get the saved Boolean value
|
static boolean |
getBoolean(android.content.Context context,
java.lang.String prefName,
java.lang.String key)
Get the saved Boolean value
|
static android.content.SharedPreferences.Editor |
getEditor(android.content.Context context)
Get the Editor
|
static android.content.SharedPreferences.Editor |
getEditor(android.content.Context context,
java.lang.String prefName)
Get the Editor
|
static float |
getFloat(android.content.Context context,
java.lang.String key)
Get the saved Float value
|
static float |
getFloat(android.content.Context context,
java.lang.String prefName,
java.lang.String key)
Get the saved Float value
|
static int |
getInt(android.content.Context context,
java.lang.String key)
Get the saved Integer value
|
static int |
getInt(android.content.Context context,
java.lang.String prefName,
java.lang.String key)
Get the saved Integer value
|
static long |
getLong(android.content.Context context,
java.lang.String key)
Get the saved Long value
|
static long |
getLong(android.content.Context context,
java.lang.String prefName,
java.lang.String key)
Get the saved Long value
|
static android.content.SharedPreferences |
getPreferences(android.content.Context context)
Get the preferences
|
static android.content.SharedPreferences |
getPreferences(android.content.Context context,
java.lang.String prefName)
Get the preferences
|
static java.util.Set<java.lang.String> |
getSet(android.content.Context context,
java.lang.String key)
Get the saved String set values
|
static java.util.Set<java.lang.String> |
getSet(android.content.Context context,
java.lang.String prefName,
java.lang.String key)
Get the saved String set values
|
static java.lang.String |
getString(android.content.Context context,
java.lang.String key)
Get the saved String value
|
static java.lang.String |
getString(android.content.Context context,
java.lang.String prefName,
java.lang.String key)
Get the saved String value
|
static void |
save(android.content.Context context,
java.lang.String key,
boolean value)
Save your preference
|
static void |
save(android.content.Context context,
java.lang.String key,
float value)
Save your preference
|
static void |
save(android.content.Context context,
java.lang.String key,
int value)
Save your preference
|
static void |
save(android.content.Context context,
java.lang.String key,
long value)
Save your preference
|
static void |
save(android.content.Context context,
java.lang.String key,
java.lang.String value)
Save your preference
|
static void |
save(android.content.Context context,
java.lang.String prefName,
java.lang.String key,
boolean value)
Save your preference
|
static void |
save(android.content.Context context,
java.lang.String prefName,
java.lang.String key,
float value)
Save your preference
|
static void |
save(android.content.Context context,
java.lang.String prefName,
java.lang.String key,
int value)
Save your preference
|
static void |
save(android.content.Context context,
java.lang.String prefName,
java.lang.String key,
long value)
Save your preference
|
static void |
save(android.content.Context context,
java.lang.String prefName,
java.lang.String key,
java.lang.String value)
Save your preference
|
static void |
saveAll(android.content.Context context,
java.util.Map<java.lang.String,?> data)
Save all the values in the Map to preferences
|
static void |
saveAll(android.content.Context context,
java.lang.String prefName,
java.util.Map<java.lang.String,?> data)
Save all the values in the Map to preferences
|
static void |
setPreferenceName(java.lang.String s)
Set a name to the preference
|
static void |
setPreferenceNameToDefault() |
public static final java.lang.String vera
public static void setPreferenceName(java.lang.String s)
s - The name of the Preferencepublic static void setPreferenceNameToDefault()
public static android.content.SharedPreferences getPreferences(android.content.Context context)
context - contextpublic static android.content.SharedPreferences getPreferences(android.content.Context context,
java.lang.String prefName)
context - contextprefName - The name of the preferencepublic static android.content.SharedPreferences.Editor getEditor(android.content.Context context)
context - contextpublic static android.content.SharedPreferences.Editor getEditor(android.content.Context context,
java.lang.String prefName)
context - contextprefName - The name of the preferencepublic static void save(android.content.Context context,
java.lang.String key,
java.lang.String value)
context - contextkey - key fot the preferencevalue - value of the preferencepublic static void save(android.content.Context context,
java.lang.String prefName,
java.lang.String key,
java.lang.String value)
context - contextprefName - The name of the preferencekey - key fot the preferencevalue - value of the preferencepublic static void save(android.content.Context context,
java.lang.String key,
int value)
context - contextkey - key fot the preferencevalue - value of the preferencepublic static void save(android.content.Context context,
java.lang.String prefName,
java.lang.String key,
int value)
context - contextprefName - The name of the preferencekey - key fot the preferencevalue - value of the preferencepublic static void save(android.content.Context context,
java.lang.String key,
long value)
context - contextkey - key fot the preferencevalue - value of the preferencepublic static void save(android.content.Context context,
java.lang.String prefName,
java.lang.String key,
long value)
context - contextprefName - The name of the preferencekey - key fot the preferencevalue - value of the preferencepublic static void save(android.content.Context context,
java.lang.String key,
float value)
context - contextkey - key fot the preferencevalue - value of the preferencepublic static void save(android.content.Context context,
java.lang.String prefName,
java.lang.String key,
float value)
context - contextprefName - The name of the preferencekey - key fot the preferencevalue - value of the preferencepublic static void save(android.content.Context context,
java.lang.String key,
boolean value)
context - contextkey - key fot the preferencevalue - value of the preferencepublic static void save(android.content.Context context,
java.lang.String prefName,
java.lang.String key,
boolean value)
context - contextprefName - The name of the preferencekey - key fot the preferencevalue - value of the preferencepublic static void saveAll(android.content.Context context,
java.util.Map<java.lang.String,?> data)
context - contextdata - data to be stored(object of Map)public static void saveAll(android.content.Context context,
java.lang.String prefName,
java.util.Map<java.lang.String,?> data)
context - contextprefName - The name of the preferencedata - data to be stored(object of Map)public static int getInt(android.content.Context context,
java.lang.String key)
context - contextkey - The key of the stored valuepublic static int getInt(android.content.Context context,
java.lang.String prefName,
java.lang.String key)
context - contextprefName - The name of the preferencekey - The key of the stored valuepublic static long getLong(android.content.Context context,
java.lang.String key)
context - contextkey - The key of the stored valuepublic static long getLong(android.content.Context context,
java.lang.String prefName,
java.lang.String key)
context - contextprefName - The name of the preferencekey - The key of the stored valuepublic static float getFloat(android.content.Context context,
java.lang.String key)
context - contextkey - The key of the stored valuepublic static float getFloat(android.content.Context context,
java.lang.String prefName,
java.lang.String key)
context - contextprefName - The name of the preferencekey - The key of the stored valuepublic static java.lang.String getString(android.content.Context context,
java.lang.String key)
context - contextkey - The key of the stored valuepublic static java.lang.String getString(android.content.Context context,
java.lang.String prefName,
java.lang.String key)
context - contextprefName - The name of the preferencekey - The key of the stored valuepublic static boolean getBoolean(android.content.Context context,
java.lang.String key)
context - contextkey - The key of the stored valuepublic static boolean getBoolean(android.content.Context context,
java.lang.String prefName,
java.lang.String key)
context - contextprefName - The name of the preferencekey - The key of the stored valuepublic static java.util.Set<java.lang.String> getSet(android.content.Context context,
java.lang.String key)
context - contextkey - The key of the stored valuepublic static java.util.Set<java.lang.String> getSet(android.content.Context context,
java.lang.String prefName,
java.lang.String key)
context - contextprefName - The name of the preferencekey - The key of the stored valuepublic static java.util.Map<java.lang.String,?> getAll(android.content.Context context)
context - contextpublic static java.util.Map<java.lang.String,?> getAll(android.content.Context context,
java.lang.String prefName)
context - contextprefName - The name of the preference