com.vodafone360.people.utils
Class LoginPreferences

java.lang.Object
  extended by com.vodafone360.people.utils.LoginPreferences

public class LoginPreferences
extends java.lang.Object

Store various preferences used during login in a preferences file. TODO: Requires some refactoring to clear up underutilised variables.


Field Summary
private static java.lang.String LAST_LOGIN_SCREEN
           
private static java.lang.String MOBILE_NUMBER
           
private static java.lang.String PASSWORD
           
private static java.lang.String PREFS_PATH
           
private static java.util.GregorianCalendar sDateOfBirth
           
private static java.lang.String SIGNUP_DOB_DAY
           
private static java.lang.String SIGNUP_DOB_MONTH
           
private static java.lang.String SIGNUP_DOB_YEAR
           
private static java.lang.String SIGNUP_EMAIL_ADDRESS
           
private static java.lang.String SIGNUP_FIRSTNAME
           
private static java.lang.String SIGNUP_LASTNAME
           
private static LoginDetails sLoginDetails
           
private static java.lang.String sMobileNumber
           
private static java.lang.String sPassword
           
private static java.lang.String sSignupEmailAddress
           
private static java.lang.String sSignupFirstName
           
private static java.lang.String sSignupLastName
           
static java.lang.String STORE_PROGRESS
           
private static java.lang.String sUsername
           
private static java.lang.String USERNAME
           
private static java.lang.String XML_FILE_EXTENSION
           
 
Constructor Summary
LoginPreferences()
           
 
Method Summary
static void clearCachedLoginDetails()
          Clear cached login details.
static void clearPreferencesFile(Context context)
          Clears all details stored in the preferences.
static java.lang.String getCurrentLoginActivity(Context context)
          Retrieves the name of the current login activity.
static LoginDetails getLoginDetails()
          Gets the current set of login parameters.
static java.lang.String getMobileNumber()
          Gets the current login mobile number.
static java.lang.String getPassword()
          Gets the current login password.
static java.util.GregorianCalendar getSignupDateOfBirth()
          Return the date of birth from current account details.
static java.lang.String getSignupEmailAddress()
          Retrieves the current account creation email address.
static java.lang.String getSignupFirstName()
          Retrieves the current account creation first name.
static java.lang.String getSignupLastName()
          Retrieves the current account creation last name.
static java.lang.String getUsername()
          Gets the current login user name.
static void initLoginDetails()
          Re-initialise login details currently held in application cache.
static void setCurrentLoginActivity(java.lang.String loginScreenName, Context context)
          Stores the name of the current login activity.
static void setLoginDetails(LoginDetails loginDetails)
          Store current login details.
static void setMobileNumber(java.lang.String mobileNumber)
          Sets the current login mobile number.
static void setPassword(java.lang.String aPassword)
          Sets the current login password.
static void setSignupDateOfBirth(int day, int month, int year)
          Set date of birth for current account.
static void setSignupEmailAddress(java.lang.String aEmailAddress)
          Sets the current account creation email address.
static void setSignupFirstName(java.lang.String aFirstName)
          Sets the current account creation first name.
static void setSignupLastName(java.lang.String aLastName)
          Sets the current account creation last name.
static void setUsername(java.lang.String username)
          Sets the current login user name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STORE_PROGRESS

public static final java.lang.String STORE_PROGRESS
See Also:
Constant Field Values

PREFS_PATH

private static final java.lang.String PREFS_PATH
See Also:
Constant Field Values

SIGNUP_EMAIL_ADDRESS

private static final java.lang.String SIGNUP_EMAIL_ADDRESS
See Also:
Constant Field Values

SIGNUP_FIRSTNAME

private static final java.lang.String SIGNUP_FIRSTNAME
See Also:
Constant Field Values

SIGNUP_LASTNAME

private static final java.lang.String SIGNUP_LASTNAME
See Also:
Constant Field Values

SIGNUP_DOB_DAY

private static final java.lang.String SIGNUP_DOB_DAY
See Also:
Constant Field Values

SIGNUP_DOB_MONTH

private static final java.lang.String SIGNUP_DOB_MONTH
See Also:
Constant Field Values

SIGNUP_DOB_YEAR

private static final java.lang.String SIGNUP_DOB_YEAR
See Also:
Constant Field Values

MOBILE_NUMBER

private static final java.lang.String MOBILE_NUMBER
See Also:
Constant Field Values

USERNAME

private static final java.lang.String USERNAME
See Also:
Constant Field Values

PASSWORD

private static final java.lang.String PASSWORD
See Also:
Constant Field Values

LAST_LOGIN_SCREEN

private static final java.lang.String LAST_LOGIN_SCREEN
See Also:
Constant Field Values

XML_FILE_EXTENSION

private static final java.lang.String XML_FILE_EXTENSION
See Also:
Constant Field Values

sSignupFirstName

private static java.lang.String sSignupFirstName

sSignupLastName

private static java.lang.String sSignupLastName

sSignupEmailAddress

private static java.lang.String sSignupEmailAddress

sDateOfBirth

private static volatile java.util.GregorianCalendar sDateOfBirth

sMobileNumber

private static java.lang.String sMobileNumber

sPassword

private static java.lang.String sPassword

sUsername

private static java.lang.String sUsername

sLoginDetails

private static LoginDetails sLoginDetails
Constructor Detail

LoginPreferences

public LoginPreferences()
Method Detail

getCurrentLoginActivity

public static java.lang.String getCurrentLoginActivity(Context context)
Retrieves the name of the current login activity. Also retrieves login details from the preferences so that the same screen is displayed when the user re-enters the wizard.

Parameters:
context - - Android context.
Returns:
The name of the current login wizard activity

setCurrentLoginActivity

public static void setCurrentLoginActivity(java.lang.String loginScreenName,
                                           Context context)
Stores the name of the current login activity. Also stores the login details in the preferences so that they can be retrieved when the user has been diverted away from the login wizard.

Parameters:
loginScreenName - The name of the current login wizard activity.

clearCachedLoginDetails

public static void clearCachedLoginDetails()
Clear cached login details.


setLoginDetails

public static void setLoginDetails(LoginDetails loginDetails)
Store current login details.

Parameters:
loginDetails - Current login details.

initLoginDetails

public static void initLoginDetails()
Re-initialise login details currently held in application cache.


getLoginDetails

public static LoginDetails getLoginDetails()
Gets the current set of login parameters.

Returns:
current login details.

getPassword

public static java.lang.String getPassword()
Gets the current login password.

Returns:
The current user entered login password.

setPassword

public static void setPassword(java.lang.String aPassword)
Sets the current login password.

Parameters:
aPassword - login password

getUsername

public static java.lang.String getUsername()
Gets the current login user name.

Returns:
The current user entered login user name.

setUsername

public static void setUsername(java.lang.String username)
Sets the current login user name.

Parameters:
username - login user name

getMobileNumber

public static java.lang.String getMobileNumber()
Gets the current login mobile number.

Returns:
The current user entered login password

setMobileNumber

public static void setMobileNumber(java.lang.String mobileNumber)
Sets the current login mobile number.

Parameters:
mobileNumber - login mobile number

setSignupEmailAddress

public static void setSignupEmailAddress(java.lang.String aEmailAddress)
Sets the current account creation email address.

Parameters:
aEmailAddress - account signup email address

getSignupEmailAddress

public static java.lang.String getSignupEmailAddress()
Retrieves the current account creation email address.

Returns:
Currently stored account creation email address

setSignupFirstName

public static void setSignupFirstName(java.lang.String aFirstName)
Sets the current account creation first name.

Parameters:
aFirstName - account creation first name

setSignupLastName

public static void setSignupLastName(java.lang.String aLastName)
Sets the current account creation last name.

Parameters:
aLastName - account creation last name

getSignupFirstName

public static java.lang.String getSignupFirstName()
Retrieves the current account creation first name.

Returns:
Current account creation first name

getSignupLastName

public static java.lang.String getSignupLastName()
Retrieves the current account creation last name.

Returns:
Current account creation last name

getSignupDateOfBirth

public static java.util.GregorianCalendar getSignupDateOfBirth()
Return the date of birth from current account details.

Returns:
Date containing date of birth

setSignupDateOfBirth

public static void setSignupDateOfBirth(int day,
                                        int month,
                                        int year)
Set date of birth for current account.

Parameters:
day - Date of birth within month.
month - Month of birth
year - Year of birth

clearPreferencesFile

public static void clearPreferencesFile(Context context)
Clears all details stored in the preferences.



JavaDoc