com.sponsorpay.sdk.android.publisher
Class PublisherHostInfo

java.lang.Object
  extended by com.sponsorpay.sdk.android.DeviceInfo
      extended by com.sponsorpay.sdk.android.publisher.PublisherHostInfo

public class PublisherHostInfo
extends DeviceInfo

Retrieves and contains all the information from DeviceInfo plus the SponsorPay App ID contained in the Android Application Manifest.


Field Summary
private  long mAppId
          The App ID value.
private static java.lang.String SPONSORPAY_APP_ID_KEY
          The Sponsorpay App ID Key that is used in the AndroidManifest.xml file.
 
Fields inherited from class com.sponsorpay.sdk.android.DeviceInfo
mContext
 
Constructor Summary
PublisherHostInfo(Context context)
          Constructor.
 
Method Summary
 long getAppId()
          Extracts the App ID from the host application's Android Manifest XML file.
 void setOverriddenAppId(long appId)
          Set the offerId, overriding the one which would be read from the manifest.
 
Methods inherited from class com.sponsorpay.sdk.android.DeviceInfo
getLanguageSetting, getLongFromAppMetadata, getOsVersion, getPhoneVersion, getStringFromAppMetadata, getUDID
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SPONSORPAY_APP_ID_KEY

private static final java.lang.String SPONSORPAY_APP_ID_KEY
The Sponsorpay App ID Key that is used in the AndroidManifest.xml file.

See Also:
Constant Field Values

mAppId

private long mAppId
The App ID value.

Constructor Detail

PublisherHostInfo

public PublisherHostInfo(Context context)
Constructor. Requires an Android application context which will be used to retrieve information from the device and the host application's Android Manifest.

Parameters:
pContext - Android application context.
Method Detail

getAppId

public long getAppId()

Extracts the App ID from the host application's Android Manifest XML file. If it's not present, it will throw a RuntimeException.

If the Offer Id has already been set (i.e. by calling the setOverriddenAppId(long)), this method will just return the id which has been set without trying to retrieve it from the manifest.

Returns:
The offer id defined in the manifest.

setOverriddenAppId

public void setOverriddenAppId(long appId)
Set the offerId, overriding the one which would be read from the manifest.

Parameters:
offerId -