com.sponsorpay.sdk.android.advertiser
Class SponsorPayAdvertiserState

java.lang.Object
  extended by com.sponsorpay.sdk.android.advertiser.SponsorPayAdvertiserState

public class SponsorPayAdvertiserState
extends java.lang.Object

Persists and retrieves the state of the Advertiser part of the SDK.


Field Summary
private  SharedPreferences mPrefs
          The shared preferences encoded in the PREFERENCES_FILE_NAME file.
private static java.lang.String PREFERENCES_FILE_NAME
          Shared preferences file name.
private static java.lang.String STATE_GOT_SUCCESSFUL_RESPONSE_KEY
          The key to store in the preferences file the flag which determines if we have already successfully contacted the Advertiser API.
private static java.lang.String STATE_INSTALL_REFERRER_KEY
          The key to store the install referrer in the preferences file
private static java.lang.String STATE_INSTALL_SUBID_KEY
          The key to store the install subID in the preferences file
 
Constructor Summary
SponsorPayAdvertiserState(Context context)
          Constructor.
 
Method Summary
 boolean getHasAdvertiserCallbackReceivedSuccessfulResponse()
          Retrieves the flag which determines if we have already successfully contacted the Advertiser API.
 java.lang.String getInstallReferrer()
          Retrieves the values of the install referrer, typically set when the host app was installed.
 java.lang.String getInstallSubId()
          Retrieves the value of the install subID.
 void setHasAdvertiserCallbackReceivedSuccessfulResponse(boolean value)
          Persists the flag which determines if we have already successfully contacted the Advertiser API.
 void setInstallReferrer(java.lang.String value)
          Persists the value of the whole install referrer.
 void setInstallSubId(java.lang.String subIdValue)
          Persists the value of the install subID.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PREFERENCES_FILE_NAME

private static final java.lang.String PREFERENCES_FILE_NAME
Shared preferences file name. We store a flag into the shared preferences which is checked on each consecutive invocation of #register(), to keep track of whether we have already successfully contacted the Advertiser API.

See Also:
Constant Field Values

STATE_GOT_SUCCESSFUL_RESPONSE_KEY

private static final java.lang.String STATE_GOT_SUCCESSFUL_RESPONSE_KEY
The key to store in the preferences file the flag which determines if we have already successfully contacted the Advertiser API.

See Also:
Constant Field Values

STATE_INSTALL_SUBID_KEY

private static final java.lang.String STATE_INSTALL_SUBID_KEY
The key to store the install subID in the preferences file

See Also:
Constant Field Values

STATE_INSTALL_REFERRER_KEY

private static final java.lang.String STATE_INSTALL_REFERRER_KEY
The key to store the install referrer in the preferences file

See Also:
Constant Field Values

mPrefs

private SharedPreferences mPrefs
The shared preferences encoded in the PREFERENCES_FILE_NAME file.

Constructor Detail

SponsorPayAdvertiserState

public SponsorPayAdvertiserState(Context context)
Constructor.

Parameters:
context - Android application context, used to gain access to the preferences file.
Method Detail

setHasAdvertiserCallbackReceivedSuccessfulResponse

public void setHasAdvertiserCallbackReceivedSuccessfulResponse(boolean value)
Persists the flag which determines if we have already successfully contacted the Advertiser API.


getHasAdvertiserCallbackReceivedSuccessfulResponse

public boolean getHasAdvertiserCallbackReceivedSuccessfulResponse()
Retrieves the flag which determines if we have already successfully contacted the Advertiser API.


setInstallSubId

public void setInstallSubId(java.lang.String subIdValue)
Persists the value of the install subID.


getInstallSubId

public java.lang.String getInstallSubId()
Retrieves the value of the install subID.


setInstallReferrer

public void setInstallReferrer(java.lang.String value)
Persists the value of the whole install referrer.


getInstallReferrer

public java.lang.String getInstallReferrer()
Retrieves the values of the install referrer, typically set when the host app was installed.

Returns: