com.sponsorpay.sdk.android
Class DeviceInfo

java.lang.Object
  extended by com.sponsorpay.sdk.android.DeviceInfo
Direct Known Subclasses:
PublisherHostInfo

public class DeviceInfo
extends java.lang.Object

Extracts device information from the host device in which the SDK runs.


Field Summary
private static java.lang.String ANDROID_OS_PREFIX
          Prefix appended to the OS version to identify the Android platform.
protected  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.
 
Constructor Summary
DeviceInfo(Context context)
          The constructor immediately retrieves all the device information.
 
Method Summary
 java.lang.String getLanguageSetting()
          Get the default locale set by the user
protected  long getLongFromAppMetadata(java.lang.String key)
          Extracts a long value from the meta-data configured in the application manifest XML file
 java.lang.String getOsVersion()
          Get the running OS version
 java.lang.String getPhoneVersion()
          Get the current phone model
protected  java.lang.String getStringFromAppMetadata(java.lang.String key)
          Extracts a String value from the meta-data configured in the application manifest XML file
 java.lang.String getUDID()
          Get the unique device ID
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ANDROID_OS_PREFIX

private static final java.lang.String ANDROID_OS_PREFIX
Prefix appended to the OS version to identify the Android platform.

See Also:
Constant Field Values

mUDID

private java.lang.String mUDID
The unique device ID.


mOsVersion

private java.lang.String mOsVersion
The running Android OS version (e.g. "2.1" for Android 2.1).


mPhoneVersion

private java.lang.String mPhoneVersion
The device version (e.g. "HTC Nexus One").


mLanguageSetting

private java.lang.String mLanguageSetting
Language settings (the default locale).


mContext

protected Context mContext
Android application context, used to retrieve the rest of the properties.

Constructor Detail

DeviceInfo

public DeviceInfo(Context context)
The constructor immediately retrieves all the device information.

Parameters:
context - Android application context
Method Detail

getUDID

public java.lang.String getUDID()
Get the unique device ID

Returns:
the unique device id

getOsVersion

public java.lang.String getOsVersion()
Get the running OS version

Returns:
the OS version

getPhoneVersion

public java.lang.String getPhoneVersion()
Get the current phone model

Returns:
the phone model

getLanguageSetting

public java.lang.String getLanguageSetting()
Get the default locale set by the user

Returns:
the default language setting

getStringFromAppMetadata

protected java.lang.String getStringFromAppMetadata(java.lang.String key)
Extracts a String value from the meta-data configured in the application manifest XML file

Parameters:
key - key to identify the piece of meta-data to return
Returns:
the value for the given key

getLongFromAppMetadata

protected long getLongFromAppMetadata(java.lang.String key)
Extracts a long value from the meta-data configured in the application manifest XML file

Parameters:
key - key to identify the piece of meta-data to return
Returns:
the value for the given key