com.nativex.common
Class SharedPreferenceManager
java.lang.Object
com.nativex.common.SharedPreferenceManager
public class SharedPreferenceManager
- extends Object
Constructor Summary |
private |
SharedPreferenceManager()
Handles initializing the shared preferences storage for the SDK. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
sharedPreferences
private static SharedPreferences sharedPreferences
PREFS_NAME
public static final String PREFS_NAME
- See Also:
- Constant Field Values
AVAILABLE_BALANCE_RESPONSE
public static final String AVAILABLE_BALANCE_RESPONSE
- See Also:
- Constant Field Values
PREVIOUS_SESSION_END_TIME
public static final String PREVIOUS_SESSION_END_TIME
- See Also:
- Constant Field Values
PREVIOUS_SESSION_ID
public static final String PREVIOUS_SESSION_ID
- See Also:
- Constant Field Values
CACHED_REDEEM_BALANCE
public static final String CACHED_REDEEM_BALANCE
- See Also:
- Constant Field Values
CACHED_GET_BALANCES
public static final String CACHED_GET_BALANCES
- See Also:
- Constant Field Values
PREF_LANGUAGE
public static final String PREF_LANGUAGE
- See Also:
- Constant Field Values
PREF_STORED_BALANCES
public static final String PREF_STORED_BALANCES
- See Also:
- Constant Field Values
PREF_FIRST_RUN
public static final String PREF_FIRST_RUN
- See Also:
- Constant Field Values
PREF_DEVICE_ID
public static final String PREF_DEVICE_ID
- See Also:
- Constant Field Values
PREF_EXTERNAL_TRACKING_NEW_DEVICE_DATE
public static final String PREF_EXTERNAL_TRACKING_NEW_DEVICE_DATE
- See Also:
- Constant Field Values
PREF_EXTERNAL_TRACKING_LAST_TRACK_TIME
public static final String PREF_EXTERNAL_TRACKING_LAST_TRACK_TIME
- See Also:
- Constant Field Values
PREF_ANDROID_ID
public static final String PREF_ANDROID_ID
- See Also:
- Constant Field Values
SharedPreferenceManager
private SharedPreferenceManager()
- Handles initializing the shared preferences storage for the SDK.
storePreviousSessionId
public static void storePreviousSessionId(String id)
getPreviousSessionId
public static String getPreviousSessionId()
storePreviousSessionEndTime
public static void storePreviousSessionEndTime(String UtcDateTime)
getPreviousSessionEndTime
public static String getPreviousSessionEndTime()
hasPreviousSessionEndTime
public static boolean hasPreviousSessionEndTime()
isInitialized
public static boolean isInitialized()
storeLanguage
public static void storeLanguage(com.nativex.monetization.enums.Language language)
getLanguge
public static String getLanguge()
release
public static void release()
loadBalances
public static Map<String,com.nativex.monetization.business.Balance> loadBalances()
isFirstRun
public static boolean isFirstRun()
- Checks to see if this application has run before.
- Returns:
- Returns true if this is the first run of the application, or false if not.
storeFirstRun
public static void storeFirstRun(boolean firstRun)
getDeviceId
public static String getDeviceId()
- Loads the W3iDeviceId from shared preferences if it is available.
- Returns:
String
. The stored device id or null if there is no device id previously stored.
storeW3iDeviceId
public static void storeW3iDeviceId(String deviceId)
storeExternalTrackingDeviceDate
public static void storeExternalTrackingDeviceDate(long milliseconds)
removeExternalTrackingRecord
public static void removeExternalTrackingRecord()
loadExternalTrackingDeviceDate
public static long loadExternalTrackingDeviceDate()
storeLastTrackTime
public static void storeLastTrackTime(long time)
loadExternalTrackingLastTrackTime
public static long loadExternalTrackingLastTrackTime()
storeAndroidId
public static void storeAndroidId(String androidId)
loadStoredAndroidId
public static String loadStoredAndroidId()
storeBalances
public static void storeBalances(Map<String,com.nativex.monetization.business.Balance> balances)
initialize
public static void initialize(Context context)
checkInit
private static void checkInit()