public class Preferences extends Object
Modifier and Type | Field and Description |
---|---|
static String |
AUTHORSPREF
Authors preference name
|
static String |
BLOGPREF
Blog preference name
|
static String |
CHANGELOGPREF
Changelog preference name
|
static String |
CURRENTVERSIONPREF
Current application version preference name
|
static String |
DBKEYPREF
Database passphrase preference name
|
private static SharedPreferences.Editor |
editor
Preferences editor
|
static String |
FACEBOOKPREF
Facebook preference name
|
static String |
GOOGLEPLUSPREF
Google Plus preference name
|
static String |
LASTCOURSESELECTEDPREF
Last course selected preference name
|
static String |
LASTSYNCTIMEPREF
Last synchronization time preference name
|
static String |
LASTVERSIONPREF
Last application version preference name
|
static String |
MAILINGLISTPREF
Mailing list preference name
|
static String |
NOTIFLIGHTSENABLEPREF
Notifications lights enable preference name
|
static String |
NOTIFLIMITPREF
Notifications limit preference name
|
static String |
NOTIFSOUNDENABLEPREF
Notifications sound enable preference name
|
static String |
NOTIFVIBRATEENABLEPREF
Notifications vibrate enable preference name
|
private static SharedPreferences |
prefs
Application preferences
|
static String |
PREFS_NAME
Preferences name
|
static String |
RATEPREF
Rate preference name
|
static String |
SERVERPREF
Server preference name
|
static String |
SHAREPREF
Share preference name
|
static String |
SYNCENABLEPREF
Synchronization enable preference name
|
static String |
SYNCTIMEPREF
Synchronization time preference name
|
static String |
TAG
Login tag name for Logcat
|
static String |
TWITTERPREF
Twitter preference name
|
static String |
USERIDPREF
User identifier preference name
|
static String |
USERPASSWORDPREF
User password preference name
|
Constructor and Description |
---|
Preferences(Context ctx)
Constructor
|
Modifier and Type | Method and Description |
---|---|
static String |
getDBKey()
Gets the database passphrase
|
static int |
getLastCourseSelected()
Gets last course selected
|
static long |
getLastSyncTime()
Gets the last synchronization time
|
static int |
getLastVersion()
Gets last application version
|
static int |
getNotifLimit()
Gets the max number of notifications to be stored
|
static String |
getServer()
Gets server URL
|
static String |
getSyncTime()
Gets the synchronization time
|
static String |
getUserID()
Gets user identifier
|
static String |
getUserPassword()
Gets User password
|
static boolean |
isNotifLightsEnabled()
Checks if the lights are enabled for notification alerts
|
static boolean |
isNotifSoundEnabled()
Checks if the sound is enabled for notification alerts
|
static boolean |
isNotifVibrateEnabled()
Checks if the vibration is enabled for notification alerts
|
static boolean |
isSyncEnabled()
Checks if automatic synchronization is enabled
|
static void |
setDBKey(String key)
Sets the database passphrase
|
static void |
setLastCourseSelected(int lcs)
Sets last course selected
|
static void |
setLastSyncTime(long time)
Sets the last synchronization time
|
static void |
setLastVersion(int lv)
Sets last application version
|
static void |
setNotifLightsEnabled(boolean notifLightsEnabled)
Enables or disables the lights for notification alerts
|
static void |
setNotifLimit(int notifLimit)
Sets the max number of notifications to be stored
|
static void |
setNotifSoundEnabled(boolean notifSoundEnabled)
Enables or disables the sound for notification alerts
|
static void |
setNotifVibrateEnabled(boolean notifVibrateEnabled)
Enables or disables the vibration for notification alerts
|
static void |
setServer(String server)
Sets server URL
|
static void |
setSyncEnabled(boolean syncEnabled)
Sets the sync enabled flag
|
static void |
setSyncTime(String syncTime)
Sets the synchronization time
|
static void |
setUserID(String userID)
Sets user id
|
static void |
setUserPassword(String userPassword)
Sets user password
|
static void |
upgradeCredentials()
Upgrade password encryption
|
public static final String TAG
public static final String PREFS_NAME
private static SharedPreferences prefs
private static SharedPreferences.Editor editor
public static final String USERIDPREF
public static final String USERPASSWORDPREF
public static final String LASTVERSIONPREF
public static final String CURRENTVERSIONPREF
public static final String LASTCOURSESELECTEDPREF
public static final String RATEPREF
public static final String TWITTERPREF
public static final String FACEBOOKPREF
public static final String GOOGLEPLUSPREF
public static final String MAILINGLISTPREF
public static final String BLOGPREF
public static final String SHAREPREF
public static final String SERVERPREF
public static final String DBKEYPREF
public static final String SYNCTIMEPREF
public static final String SYNCENABLEPREF
public static final String NOTIFLIMITPREF
public static final String LASTSYNCTIMEPREF
public static final String NOTIFSOUNDENABLEPREF
public static final String NOTIFVIBRATEENABLEPREF
public static final String NOTIFLIGHTSENABLEPREF
public static final String CHANGELOGPREF
public static final String AUTHORSPREF
public Preferences(Context ctx)
public static String getUserID()
public static void setUserID(String userID)
public static String getUserPassword()
public static void setUserPassword(String userPassword)
public static String getServer()
public static void setServer(String server)
server
- Server URLpublic static int getLastVersion()
public static void setLastVersion(int lv)
public static int getLastCourseSelected()
public static void setLastCourseSelected(int lcs)
public static String getDBKey()
public static int getNotifLimit()
public static void setNotifLimit(int notifLimit)
notifLimit
- The max number of notifications to be storedpublic static String getSyncTime()
public static void setSyncTime(String syncTime)
syncTime
- The synchronization timepublic static long getLastSyncTime()
public static void setLastSyncTime(long time)
time
- The last synchronization timepublic static boolean isSyncEnabled()
public static void setSyncEnabled(boolean syncEnabled)
syncEnabled
- true if automatic synchronization is enabled
false otherwisepublic static void setDBKey(String key)
key
- The database passphrasepublic static boolean isNotifSoundEnabled()
public static void setNotifSoundEnabled(boolean notifSoundEnabled)
notifSoundEnabled
- true if the sound is enabled for notification alerts
false otherwisepublic static boolean isNotifVibrateEnabled()
public static void setNotifVibrateEnabled(boolean notifVibrateEnabled)
notifVibrateEnabled
- the notifVibrateEnabled to setpublic static boolean isNotifLightsEnabled()
public static void setNotifLightsEnabled(boolean notifLightsEnabled)
notifLightsEnabled
- true if the lights are enabled for notification alerts
false otherwisepublic static void upgradeCredentials() throws NoSuchAlgorithmException
NoSuchAlgorithmException