|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sponsorpay.sdk.android.HostInfo
public class HostInfo
Extracts device information from the host device in which the SDK runs and SponsorPay App ID contained in the Android Application Manifest of the host app.
Field Summary | |
---|---|
private static java.lang.String |
ANDROID_OS_PREFIX
Prefix appended to the OS version to identify the Android platform. |
private java.lang.String |
mAndroidId
Android ID as reported by Settings.Secure |
private java.lang.String |
mAppId
The App ID value. |
private Context |
mContext
Android application context, used to retrieve the rest of the properties. |
private java.lang.String |
mLanguageSetting
Language settings (the default locale). |
private java.lang.String |
mOsVersion
The running Android OS version (e.g. |
private java.lang.String |
mPhoneVersion
The device version (e.g. |
private java.lang.String |
mUDID
The unique device ID. |
private java.lang.String |
mWifiMacAddress
MAC Address of the WiFi Adapter |
private static java.lang.String |
SPONSORPAY_APP_ID_KEY
The Sponsorpay App ID Key that is used in the AndroidManifest.xml file. |
Constructor Summary | |
---|---|
HostInfo(Context context)
Constructor. |
Method Summary | |
---|---|
java.lang.String |
getAndroidId()
Returns the device's Android ID. |
java.lang.String |
getAppId()
Extracts the App ID from the host application's Android Manifest XML file. |
java.lang.String |
getLanguageSetting()
Get the default locale set by the user |
java.lang.String |
getOsVersion()
Get the running OS version |
java.lang.String |
getPhoneVersion()
Get the current phone model |
java.lang.String |
getUDID()
Get the unique device ID |
private java.lang.String |
getValueFromAppMetadata(java.lang.String key)
Extracts numeric or alphanumeric value from the meta-data configured in the application manifest XML file and returns it as a String. |
java.lang.String |
getWifiMacAddress()
Returns the MAC address of the device's WiFi adapter. |
void |
setOverriddenAppId(java.lang.String appId)
Set the offerId, overriding the one which would be read from the manifest. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final java.lang.String ANDROID_OS_PREFIX
private java.lang.String mUDID
private java.lang.String mOsVersion
private java.lang.String mPhoneVersion
private java.lang.String mLanguageSetting
private java.lang.String mAndroidId
private java.lang.String mWifiMacAddress
private static final java.lang.String SPONSORPAY_APP_ID_KEY
private java.lang.String mAppId
private Context mContext
Constructor Detail |
---|
public HostInfo(Context context)
context
- Android application contextMethod Detail |
---|
public java.lang.String getUDID()
public java.lang.String getOsVersion()
public java.lang.String getPhoneVersion()
public java.lang.String getLanguageSetting()
public java.lang.String getAndroidId()
public java.lang.String getWifiMacAddress()
private java.lang.String getValueFromAppMetadata(java.lang.String key)
key
- key to identify the piece of meta-data to return.
public java.lang.String getAppId()
Extracts the App ID from the host application's Android Manifest XML file.
If the App Id has already been set (i.e. by calling the setOverriddenAppId(String)
),
this method will just return the id which has been set without trying to retrieve it from the
manifest.
If no App ID is present in the manifest and no non-empty App ID has been set by calling the mentioned method, this method will throw a RuntimeException.
public void setOverriddenAppId(java.lang.String appId)
offerId
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |