com.sponsorpay.sdk.android.publisher
Class OfferWallActivity

java.lang.Object
  extended by Activity
      extended by com.sponsorpay.sdk.android.publisher.OfferWallActivity

public class OfferWallActivity
extends Activity

Retrieves the SponsorPay mobile Offer Wall and shows it embedded in a WebView.


Nested Class Summary
 class OfferWallActivity.MobileOfferWallTemplate
           
 class OfferWallActivity.OfferWallTemplate
           
 class OfferWallActivity.UnlockOfferWallTemplate
           
 
Field Summary
static java.lang.String EXTRA_KEYS_VALUES_MAP
          Key for extracting a map of custom key/values to add to the parameters on the OfferWall request URL from the extras bundle.
static java.lang.String EXTRA_OFFERWALL_TYPE
           
static java.lang.String EXTRA_OVERRIDEN_APP_ID
          Key for extracting the App ID from the extras bundle.
static java.lang.String EXTRA_SHOULD_STAY_OPEN_KEY
          Key for extracting the value of mShouldStayOpen from the extras bundle.
static java.lang.String EXTRA_USERID_KEY
          Key for extracting the current user ID from the extras bundle.
protected  java.util.Map<java.lang.String,java.lang.String> mCustomKeysValues
          Map of custom key/values to add to the parameters on the OfferWall request URL.
private  AlertDialog mErrorDialog
          Error dialog.
protected  HostInfo mHostInfo
          Information about the hosting application and device.
private  ProgressDialog mProgressDialog
          Loading progress dialog.
private  boolean mShouldStayOpen
          Whether this activity should stay open or close when the user is redirected outside the application by clicking on an offer.
private  OfferWallActivity.OfferWallTemplate mTemplate
           
protected  UserId mUserId
          The user ID (after extracting it from the extra)
protected  WebView mWebView
          Full-size web view within the activity
static java.lang.String OFFERWALL_TYPE_MOBILE
           
static java.lang.String OFFERWALL_TYPE_UNLOCK
           
static int RESULT_CODE_NO_STATUS_CODE
          The result code that is returned when the Offer Wall's parsed exit scheme does not contain a status code.
 
Constructor Summary
OfferWallActivity()
           
 
Method Summary
protected  void fetchPassedExtras()
           
private  java.lang.String generateUrl()
           
private  void instantiateTemplate()
           
protected  void onCreate(Bundle savedInstanceState)
          Overriden from Activity.
protected  void onPause()
           
protected  void onResume()
          Overriden from Activity.
protected  void showErrorDialog(SponsorPayPublisher.UIStringIdentifier error)
          Displays an error dialog with the passed error message on top of the activity.
protected  void showErrorDialog(java.lang.String error)
          Displays an error dialog with the passed error message on top of the activity.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EXTRA_OFFERWALL_TYPE

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

OFFERWALL_TYPE_MOBILE

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

OFFERWALL_TYPE_UNLOCK

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

EXTRA_USERID_KEY

public static final java.lang.String EXTRA_USERID_KEY
Key for extracting the current user ID from the extras bundle.

See Also:
Constant Field Values

EXTRA_SHOULD_STAY_OPEN_KEY

public static final java.lang.String EXTRA_SHOULD_STAY_OPEN_KEY
Key for extracting the value of mShouldStayOpen from the extras bundle.

See Also:
Constant Field Values

EXTRA_OVERRIDEN_APP_ID

public static final java.lang.String EXTRA_OVERRIDEN_APP_ID
Key for extracting the App ID from the extras bundle. If no app id is provided it will be retrieved from the application manifest.

See Also:
Constant Field Values

EXTRA_KEYS_VALUES_MAP

public static final java.lang.String EXTRA_KEYS_VALUES_MAP
Key for extracting a map of custom key/values to add to the parameters on the OfferWall request URL from the extras bundle.

See Also:
Constant Field Values

RESULT_CODE_NO_STATUS_CODE

public static final int RESULT_CODE_NO_STATUS_CODE
The result code that is returned when the Offer Wall's parsed exit scheme does not contain a status code.

See Also:
Constant Field Values

mWebView

protected WebView mWebView
Full-size web view within the activity


mUserId

protected UserId mUserId
The user ID (after extracting it from the extra)


mHostInfo

protected HostInfo mHostInfo
Information about the hosting application and device.


mShouldStayOpen

private boolean mShouldStayOpen
Whether this activity should stay open or close when the user is redirected outside the application by clicking on an offer.


mCustomKeysValues

protected java.util.Map<java.lang.String,java.lang.String> mCustomKeysValues
Map of custom key/values to add to the parameters on the OfferWall request URL.


mProgressDialog

private ProgressDialog mProgressDialog
Loading progress dialog.


mErrorDialog

private AlertDialog mErrorDialog
Error dialog.


mTemplate

private OfferWallActivity.OfferWallTemplate mTemplate
Constructor Detail

OfferWallActivity

public OfferWallActivity()
Method Detail

onCreate

protected void onCreate(Bundle savedInstanceState)
Overriden from Activity. Upon activity start, extract the user ID from the extra, create the web view and setup the interceptor for the web view exit-request.

Parameters:
savedInstanceState - Android's savedInstanceState

instantiateTemplate

private void instantiateTemplate()

fetchPassedExtras

protected void fetchPassedExtras()

onPause

protected void onPause()

onResume

protected void onResume()
Overriden from Activity. Loads or reloads the contents of the offer wall webview.


generateUrl

private java.lang.String generateUrl()

showErrorDialog

protected void showErrorDialog(SponsorPayPublisher.UIStringIdentifier error)
Displays an error dialog with the passed error message on top of the activity.

Parameters:
error - Error message to show.

showErrorDialog

protected void showErrorDialog(java.lang.String error)
Displays an error dialog with the passed error message on top of the activity.

Parameters:
error - Error message to show.