Added in API level 1
public interface

IDeviceStatusManager

com.ardic.android.managers.devicestatus.IDeviceStatusManager

Class Overview

Provides a set of APIs for miscellaneous device status information such as cellular info, storage info, network usage info, etc. on the device.

Summary

Public Methods
abstract int getAfexSdkVersion()
Returns Afex SDK (Software Development Kit version) Version (API LEVEL)
abstract int getAndroidSdkVersion()
Returns the user-visible SDK version of the framework.
abstract String getAndroidVersion()
Returns android version code.
abstract DataSizeUnit getAvailableInternalMemorySize()
Returns current available internal memory (userdata) size information.
abstract DataSizeUnit getAvailableRam()
Returns the current available Random Access Memory (RAM) information.
abstract String getBatteryLevel()
Returns current battery usage percentage [0-100].
abstract String getBatteryScale()
Returns current battery scale.
abstract int getBatterySource()
Returns current battery source.
abstract String getBatteryTemperature()
Returns current battery temperature in celcius.
abstract String getBatteryVoltage()
Returns current battery voltage in mV.
abstract String getBluetoothMacAddress()
Returns bluetooth MAC address.
abstract String getBuildDisplayId()
Returns build display id.
abstract String getCurrentDate()
Returns current date.
abstract String getCurrentTime()
Returns current time.
abstract String getCurrentTimeZone()
Returns current timezone information.
abstract String getCurrentWifiApnSsid()
Returns current connected wifi APN SSID.
abstract String getDeviceMaker()
Returns the manufacturer of the product/hardware.
abstract String getDeviceModelName()
Returns the end-user-visible name for the end product.
abstract String getDeviceModelNumber()
Returns the model number of the device.
abstract String getDeviceName()
Returns the name of the industrial design.
abstract String getDeviceOsName()
Returns string convention of version code of android.
abstract String getDevicePlatform()
Returns the name of the underlying platform
abstract String getDeviceSerialNumber()
Returns A hardware serial number, if available.
abstract String getDeviceUniqueId()
Returns device unique id
abstract String getIpAddress()
Returns the IP address currently assigned to the device for a Wi-Fi Connection.
abstract DataSizeUnit getMobileDataReceivedUsage()
Returns mobile data received (download) information.
abstract DataSizeUnit getMobileDataSentUsage()
Returns mobile data sent (upload) information.
abstract DataSizeUnit getMobileDataTotalUsage()
Returns mobile (cellular) data total (upload+download) information.
abstract CellInfo getRegisteredCellTowerInfo()
Returns registered network cell information as CellInfo if it is not registered, returns null.
abstract String getTelephonyCompleteVoiceMailNumber()
Returns complete voice mail number.
abstract String getTelephonyDeviceId()
Returns the unique device ID.
abstract String getTelephonyIsimDomain()
Returns ISIM (IP Multimedia Services Identity Module) Domain.
abstract String getTelephonyIsimImpi()
Returns ISIMIMPI IP Multimedia Services Identity Module, IP Multimedia Private Identity.
abstract String getTelephonyLine1Number()
Returns the phone number string for line 1.
abstract String getTelephonyMsisdn()
Return Telephony MSISDN (Mobile Subscriber Integrated Services Digital Network-Number)
abstract List<NeighboringCellInfo> getTelephonyNeighboringInfos()
Returns the neighboring cell(s) information of the device.
abstract String getTelephonyNetworkOperator()
Returns the numeric name (MCC+MNC) of current registered operator.
abstract String getTelephonyNetworkOperatorName()
Returns the alphabetic name of current registered operator.
abstract String getTelephonyNetworkTypeName()
Returns a constant indicating the radio technology (network type) currently in use on the device for data transmission.
abstract String getTelephonyRadioVersion()
Returns the version string for the radio firmware.
abstract String getTelephonySimCountryIso()
Returns the ISO country code equivalent of the current registered operator's MCC (Mobile Country Code).
abstract String getTelephonySimOperator()
Returns the MCC+MNC (mobile country code + mobile network code) of the provider of the SIM.
abstract String getTelephonySimOperatorName()
Returns the Service Provider Name (SPN).
abstract String getTelephonySimSerialNumber()
Returns the SIM serial number (Integrated Circuit Card ID (ICCID)), if applicable.
abstract int getTelephonySimState()
Returns a constant indicating the state of the device SIM card.
abstract String getTelephonySubscriberId()
Returns the unique subscriber ID, for example, the IMSI for a GSM phone.
abstract String getTelephonyVoiceMailAlphaTag()
Retrieves the alphabetic identifier associated with the voice mail number.
abstract String getTelephonyVoiceMailNumber()
Returns the voice mail number.
abstract String getTelephonyVoiceMessageCount()
Returns current voice message count.
abstract DataSizeUnit getTotalInternalMemorySize()
Returns current total internal memory (userdata) size information.
abstract DataSizeUnit getTotalNetworkReceivedUsage()
Returns total (wifi and mobile) received (download) network information.
abstract DataSizeUnit getTotalNetworkSentUsage()
Returns total (wifi and mobile) sent (upload) network information.
abstract DataSizeUnit getTotalNetworkUsage()
Returns total (wifi and mobile) sent and received (upload and download) network information.
abstract DataSizeUnit getTotalRam()
Returns total Random Access Memory (RAM) information.
abstract DataSizeUnit getWifiDataReceivedUsage()
Returns wifi total received (download) network information.
abstract DataSizeUnit getWifiDataSentUsage()
Returns wifi total sent (upload) network information.
abstract DataSizeUnit getWifiDataTotalUsage()
Returns wifi total (sent and received / upload and download) network information.
abstract String getWifiMacAddress()
Returns the hardware address of the wifi.
abstract boolean isBluetoothSupported()
Returns bluetooth support information.
abstract boolean isCurrentWifiApnSsidHidden()
Returns current connected wifi APN SSID is hidden or not.
abstract boolean isDeviceRooted()
Returns device rooted info.
abstract boolean isExternalMemoryAvailable()
Returns availability of external memory on the device.
abstract boolean isTelephonyNetworkRoaming()
Returns true if the device is considered roaming on the current network.
abstract boolean registerApiLicenseListener(ApiLicenseListener listener, Handler handler)
Register Api License Listener Call this api in Activity or Service's onCreate(Bundle) Normally listeners are added in an Activity or Service's onCreate(Bundle) and removed in onDestroy().
abstract boolean registerSimStateAction(ISimActionCallback simActionCallback)
Registers to sim state changes with callback function.
abstract boolean unregisterApiLicenseListener(ApiLicenseListener listener)
Unregister Api License Listener Call this api in Activity or Service's onDestroy(Bundle)
abstract boolean unregisterSimStateAction()
Unregisters from sim state changes with callback function.

Public Methods

public abstract int getAfexSdkVersion ()

Added in API level 1

Returns Afex SDK (Software Development Kit version) Version (API LEVEL)

Returns
int Afex Sdk Version as integer ERROR(/AfexBuild.API_LEVELS#API_LEVEL_1), ERROR(/AfexBuild.API_LEVELS#API_LEVEL_2)
Throws
AfexException

public abstract int getAndroidSdkVersion ()

Added in API level 1

Returns the user-visible SDK version of the framework.

Returns
int String
Throws
AfexException

public abstract String getAndroidVersion ()

Added in API level 1

Returns android version code. (For example 4.2.2)

Returns
String String
Throws
AfexException

public abstract DataSizeUnit getAvailableInternalMemorySize ()

Added in API level 1

Returns current available internal memory (userdata) size information.

Returns
DataSizeUnit DataSizeUnit
Throws
AfexException

public abstract DataSizeUnit getAvailableRam ()

Added in API level 1

Returns the current available Random Access Memory (RAM) information.

Returns
DataSizeUnit DataSizeUnit
Throws
AfexException

public abstract String getBatteryLevel ()

Added in API level 1

Returns current battery usage percentage [0-100].

Returns
String String
Throws
AfexException

public abstract String getBatteryScale ()

Added in API level 1

Returns current battery scale.

Returns
String String
Throws
AfexException

public abstract int getBatterySource ()

Added in API level 1

Returns current battery source.

Possible return values are;

BATTERY_PLUGGED_AC,

BATTERY_PLUGGED_USB

Returns
int int
Throws
AfexException

public abstract String getBatteryTemperature ()

Added in API level 1

Returns current battery temperature in celcius. (For example, 28.6 °C)

Returns
String String
Throws
AfexException

public abstract String getBatteryVoltage ()

Added in API level 1

Returns current battery voltage in mV.

Returns
String String
Throws
AfexException

public abstract String getBluetoothMacAddress ()

Added in API level 1

Returns bluetooth MAC address.

Returns
String String
Throws
AfexException

public abstract String getBuildDisplayId ()

Added in API level 1

Returns build display id.

Returns
String String
Throws
AfexException

public abstract String getCurrentDate ()

Added in API level 1

Returns current date.

Returns
String String
Throws
AfexException

public abstract String getCurrentTime ()

Added in API level 1

Returns current time.

Returns
String String
Throws
AfexException

public abstract String getCurrentTimeZone ()

Added in API level 1

Returns current timezone information.

Returns
String String
Throws
AfexException

public abstract String getCurrentWifiApnSsid ()

Added in API level 1

Returns current connected wifi APN SSID.

Returns
String String
Throws
AfexException

public abstract String getDeviceMaker ()

Added in API level 1

Returns the manufacturer of the product/hardware.

Returns
String String
Throws
AfexException

public abstract String getDeviceModelName ()

Added in API level 1

Returns the end-user-visible name for the end product.

Returns
String String
Throws
AfexException

public abstract String getDeviceModelNumber ()

Added in API level 1

Returns the model number of the device.

Returns
String String
Throws
AfexException

public abstract String getDeviceName ()

Added in API level 1

Returns the name of the industrial design.

Returns
String String
Throws
AfexException

public abstract String getDeviceOsName ()

Added in API level 1

Returns string convention of version code of android. (For example "JELLY_BEAN")

Returns
String String
Throws
AfexException

public abstract String getDevicePlatform ()

Added in API level 1

Returns the name of the underlying platform

Returns
String String
Throws
AfexException

public abstract String getDeviceSerialNumber ()

Added in API level 1

Returns A hardware serial number, if available. Alphanumeric only, case-insensitive.

Returns
String String
Throws
AfexException

public abstract String getDeviceUniqueId ()

Added in API level 1

Returns device unique id

Returns
String Device unique id as String
Throws
AfexException

public abstract String getIpAddress ()

Added in API level 1

Returns the IP address currently assigned to the device for a Wi-Fi Connection.

Returns
String Formatted and comma-separated IP addresses or "".
Throws
AfexException

public abstract DataSizeUnit getMobileDataReceivedUsage ()

Added in API level 1

Returns mobile data received (download) information.

Returns
DataSizeUnit DataSizeUnit
Throws
AfexException

public abstract DataSizeUnit getMobileDataSentUsage ()

Added in API level 1

Returns mobile data sent (upload) information.

Returns
DataSizeUnit DataSizeUnit
Throws
AfexException

public abstract DataSizeUnit getMobileDataTotalUsage ()

Added in API level 1

Returns mobile (cellular) data total (upload+download) information.

Returns
DataSizeUnit DataSizeUnit
Throws
AfexException

public abstract CellInfo getRegisteredCellTowerInfo ()

Added in API level 2

Returns registered network cell information as CellInfo if it is not registered, returns null.

 IDeviceStatusManager deviceStatusManager = DeviceStatusManager.getInterface(mContext);
 CellInfo cellInfo = deviceStatusManager.getRegisteredCellTowerInfo();
 if (cellInfo instanceof CellInfoGsm) {
     CellInfoGsm gsm = (CellInfoGsm) cellInfo;
     txtCellTowerInfo.setText("Cid: " + gsm.getCellIdentity().getCid() + "\n"
             + "Lac: " + gsm.getCellIdentity().getLac() + "\n"
             + "Mcc" + gsm.getCellIdentity().getMcc() + "\n"
             + "Mnc" + gsm.getCellIdentity().getMnc() + "\n"
             + "Asu Level: " + gsm.getCellSignalStrength().getAsuLevel() + "\n");
 } else if (cellInfo instanceof CellInfoCdma) {
     CellInfoCdma cdma = (CellInfoCdma) cellInfo;
     txtCellTowerInfo.setText("Base Station Id: " + cdma.getCellIdentity().getBasestationId() + "\n"
             + "Latitude: " + cdma.getCellIdentity().getLatitude() + "\n"
             + "Longtitude: " + cdma.getCellIdentity().getLongitude() + "\n"
             + "Network Id: " + cdma.getCellIdentity().getNetworkId() + "\n"
             + "System Id: " + cdma.getCellIdentity().getSystemId() + "\n"
             + "Asu Level: " + cdma.getCellSignalStrength().getAsuLevel());
 } else if (cellInfo instanceof CellInfoLte) {
     CellInfoLte lte = (CellInfoLte) cellInfo;
     txtCellTowerInfo.setText("Ci: " + lte.getCellIdentity().getCi() + "\n"
             + "Mcc: " + lte.getCellIdentity().getMcc() + "\n"
             + "Mnc: " + lte.getCellIdentity().getMnc() + "\n"
             + "Pci: " + lte.getCellIdentity().getPci() + "\n"
             + "Tac: " + lte.getCellIdentity().getTac() + "\n"
             + "Asu Level: " + lte.getCellSignalStrength().getAsuLevel());
 }
 

Returns
CellInfo CellInfo
Throws
AfexException

public abstract String getTelephonyCompleteVoiceMailNumber ()

Added in API level 1

Returns complete voice mail number.

Returns
String String
Throws
AfexException

public abstract String getTelephonyDeviceId ()

Added in API level 1

Returns the unique device ID. For example, the IMEI for GSM and the MEID or ESN for CDMA phones.

Returns
String String
Throws
AfexException

public abstract String getTelephonyIsimDomain ()

Added in API level 1

Returns ISIM (IP Multimedia Services Identity Module) Domain.

Returns
String String
Throws
AfexException

public abstract String getTelephonyIsimImpi ()

Added in API level 1

Returns ISIMIMPI IP Multimedia Services Identity Module, IP Multimedia Private Identity.

Returns
String String
Throws
AfexException

public abstract String getTelephonyLine1Number ()

Added in API level 1

Returns the phone number string for line 1. For example, the MSISDN for a GSM phone.

Returns
String String
Throws
AfexException

public abstract String getTelephonyMsisdn ()

Added in API level 1

Return Telephony MSISDN (Mobile Subscriber Integrated Services Digital Network-Number)

Returns
String String
Throws
AfexException

public abstract List<NeighboringCellInfo> getTelephonyNeighboringInfos ()

Added in API level 1

Returns the neighboring cell(s) information of the device.

Returns
List<NeighboringCellInfo> List of NeighboringCellInfo
Throws
AfexException

public abstract String getTelephonyNetworkOperator ()

Added in API level 1

Returns the numeric name (MCC+MNC) of current registered operator.

Returns
String String
Throws
AfexException

public abstract String getTelephonyNetworkOperatorName ()

Added in API level 1

Returns the alphabetic name of current registered operator.

Returns
String String
Throws
AfexException

public abstract String getTelephonyNetworkTypeName ()

Added in API level 1

Returns a constant indicating the radio technology (network type) currently in use on the device for data transmission.

Returns
String String
Throws
AfexException

public abstract String getTelephonyRadioVersion ()

Added in API level 1

Returns the version string for the radio firmware. May return null (if the radio is not currently on).

Returns
String String
Throws
AfexException

public abstract String getTelephonySimCountryIso ()

Added in API level 1

Returns the ISO country code equivalent of the current registered operator's MCC (Mobile Country Code).

A mobile network code (MNC) is used in combination with a mobile country code (MCC) (also known as a "MCC / MNC tuple") to uniquely identify a mobile phone operator/carrier using the GSM/LTE, CDMA, iDEN, TETRA and UMTS public land mobile networks and some satellite mobile networks.

Returns
String String
Throws
AfexException

public abstract String getTelephonySimOperator ()

Added in API level 1

Returns the MCC+MNC (mobile country code + mobile network code) of the provider of the SIM. (SIM OPERATOR CODE)

Returns
String String
Throws
AfexException

public abstract String getTelephonySimOperatorName ()

Added in API level 1

Returns the Service Provider Name (SPN).

Returns
String String
Throws
AfexException

public abstract String getTelephonySimSerialNumber ()

Added in API level 1

Returns the SIM serial number (Integrated Circuit Card ID (ICCID)), if applicable.

Returns
String String
Throws
AfexException

public abstract int getTelephonySimState ()

Added in API level 1

Returns a constant indicating the state of the device SIM card.

Possible return values are;

SIM_STATE_ABSENT,

SIM_STATE_NETWORK_LOCKED,

SIM_STATE_PIN_REQUIRED,

SIM_STATE_PUK_REQUIRED,

SIM_STATE_READY,

SIM_STATE_UNKNOWN

Returns
int String
Throws
AfexException

public abstract String getTelephonySubscriberId ()

Added in API level 1

Returns the unique subscriber ID, for example, the IMSI for a GSM phone.

Returns
String String
Throws
AfexException

public abstract String getTelephonyVoiceMailAlphaTag ()

Added in API level 1

Retrieves the alphabetic identifier associated with the voice mail number.

Returns
String String
Throws
AfexException

public abstract String getTelephonyVoiceMailNumber ()

Added in API level 1

Returns the voice mail number.

Returns
String String
Throws
AfexException

public abstract String getTelephonyVoiceMessageCount ()

Added in API level 1

Returns current voice message count.

Returns
String String
Throws
AfexException

public abstract DataSizeUnit getTotalInternalMemorySize ()

Added in API level 1

Returns current total internal memory (userdata) size information.

Returns
DataSizeUnit DataSizeUnit
Throws
AfexException

public abstract DataSizeUnit getTotalNetworkReceivedUsage ()

Added in API level 1

Returns total (wifi and mobile) received (download) network information.

Returns
DataSizeUnit DataSizeUnit
Throws
AfexException

public abstract DataSizeUnit getTotalNetworkSentUsage ()

Added in API level 1

Returns total (wifi and mobile) sent (upload) network information.

Returns
DataSizeUnit DataSizeUnit
Throws
AfexException

public abstract DataSizeUnit getTotalNetworkUsage ()

Added in API level 1

Returns total (wifi and mobile) sent and received (upload and download) network information.

Returns
DataSizeUnit DataSizeUnit
Throws
AfexException

public abstract DataSizeUnit getTotalRam ()

Added in API level 1

Returns total Random Access Memory (RAM) information.

Returns
DataSizeUnit DataSizeUnit
Throws
AfexException

public abstract DataSizeUnit getWifiDataReceivedUsage ()

Added in API level 1

Returns wifi total received (download) network information.

Returns
DataSizeUnit DataSizeUnit
Throws
AfexException

public abstract DataSizeUnit getWifiDataSentUsage ()

Added in API level 1

Returns wifi total sent (upload) network information.

Returns
DataSizeUnit DataSizeUnit
Throws
AfexException

public abstract DataSizeUnit getWifiDataTotalUsage ()

Added in API level 1

Returns wifi total (sent and received / upload and download) network information.

Returns
DataSizeUnit DataSizeUnit
Throws
AfexException

public abstract String getWifiMacAddress ()

Added in API level 1

Returns the hardware address of the wifi.

Returns
String String
Throws
AfexException

public abstract boolean isBluetoothSupported ()

Added in API level 1

Returns bluetooth support information.

Returns
boolean true if bluetooth supported on the device else false
Throws
AfexException

public abstract boolean isCurrentWifiApnSsidHidden ()

Added in API level 1

Returns current connected wifi APN SSID is hidden or not.

Returns
boolean true if connected APN is hidden else false
Throws
AfexException

public abstract boolean isDeviceRooted ()

Added in API level 1

Returns device rooted info.

Returns
boolean true if device has been rooted else false
Throws
AfexException

public abstract boolean isExternalMemoryAvailable ()

Added in API level 1

Returns availability of external memory on the device.

Returns
boolean true if external memory exists on the device else false
Throws
AfexException

public abstract boolean isTelephonyNetworkRoaming ()

Added in API level 1

Returns true if the device is considered roaming on the current network. Availability: Only when user registered to a network.

Returns
boolean true if roaming else false
Throws
AfexException

public abstract boolean registerApiLicenseListener (ApiLicenseListener listener, Handler handler)

Added in API level 5

Register Api License Listener Call this api in Activity or Service's onCreate(Bundle) Normally listeners are added in an Activity or Service's onCreate(Bundle) and removed in onDestroy().

It is safe to call this method from the main thread.

Parameters
listener ApiLicenseListener: The listener to send notifications to
handler Handler: Handler identifying the thread to use for notifications, null for the main thread
Returns
boolean
Throws
AfexException
AfexException

public abstract boolean registerSimStateAction (ISimActionCallback simActionCallback)

Added in API level 1

Registers to sim state changes with callback function.

 ISimActionCallback iSimActionCallback = new ISimActionCallback.Stub() {
     // @Override
     public void onSimStateChanged(int simState) throws RemoteException {
     }
 };
 
 try {
     DeviceStatusManager.getInterface(getApplicationContext()).registerSimStateAction(
             iSimActionCallback);
 } catch (AfexException e) {
     e.printStackTrace();
 }
 

Parameters
simActionCallback ISimActionCallback: ISimActionCallback
Returns
boolean
Throws
AfexException
AfexException

public abstract boolean unregisterApiLicenseListener (ApiLicenseListener listener)

Added in API level 5

Unregister Api License Listener Call this api in Activity or Service's onDestroy(Bundle)

Parameters
listener ApiLicenseListener: The previously added listener to remove
Returns
boolean
Throws
AfexException

public abstract boolean unregisterSimStateAction ()

Added in API level 1

Unregisters from sim state changes with callback function.

Returns
boolean
Throws
AfexException