public class WelcomeHelper
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected static boolean |
ALWAYS_SHOW_WELCOME |
static java.lang.String |
PREF_LAST_RUN_VERSION_CODE |
| Constructor and Description |
|---|
WelcomeHelper() |
| Modifier and Type | Method and Description |
|---|---|
static void |
clearLastRunVersionCode(android.content.Context context) |
static int |
getInstallVersionCode(android.content.Context context)
Returns the version code of the currently running app
|
static int |
getLastRunVersionCode(android.content.Context context)
Returns the last known version code of app as stored by a shared preference
|
static int |
getSharedPreferenceInt(android.content.Context context,
java.lang.String key)
Return int value of shared preference specifies by key
|
static boolean |
isWelcomeRequired(android.content.Context context)
Used to determine whether your main activity should display the welcome activity first.
|
static void |
putSharedPreferenceInt(android.content.Context context,
java.lang.String key,
int value)
Sets a shared preference key to specified int value
|
static void |
setAlwaysShowWelcome(boolean show)
Flag to set if you want isWelcomeRequired to always return true.
|
static void |
setLastRunVersionCode(android.content.Context context,
int versionCode)
Stores the specified version code in a shared preference
|
static void |
updatetLastRunVersionCode(android.content.Context context) |
public static final java.lang.String PREF_LAST_RUN_VERSION_CODE
protected static boolean ALWAYS_SHOW_WELCOME
public static void setAlwaysShowWelcome(boolean show)
show - turns override on/off (off by default)public static boolean isWelcomeRequired(android.content.Context context)
context - application context for getting shared preferencespublic static int getLastRunVersionCode(android.content.Context context)
context - public static void clearLastRunVersionCode(android.content.Context context)
public static void updatetLastRunVersionCode(android.content.Context context)
public static void setLastRunVersionCode(android.content.Context context,
int versionCode)
context - versionCode - public static int getInstallVersionCode(android.content.Context context)
context - public static int getSharedPreferenceInt(android.content.Context context,
java.lang.String key)
context - key - public static void putSharedPreferenceInt(android.content.Context context,
java.lang.String key,
int value)
context - key - value -