Description
The AndroidDeviceInfo
object provides information about the given Android device. The following table lists the AndroidDeviceInfo
object properties.
Note: | All of these properties are read-only. |
Property | Description |
---|---|
BatteryLevel |
Integer. The percentage of the battery charge level. |
CPU_ABI |
String. The name of the instruction set (the CPU type + ABI convention) of native code. |
Device |
String. The design name of the device. |
Fingerprint |
String. A unique identifier of the currently running operating system. |
Manufacturer |
String. The device manufacturer. |
Model |
String. The device name visible to the user. |
Product |
String. The complete product name. |
Example
The following code gets the AndroidDeviceInfo
object and posts some of its property values to the test log:
JavaScript, JScript
function GetDeviceInfo()
{
var DeviceInfoObj = Mobile.Device("MyDevice").DeviceInfo;
Log.Message("Device design name: " + DeviceInfoObj.Device);
Log.Message("Device model: " + DeviceInfoObj.Model);
Log.Message("CPU type:" + DeviceInfoObj.CPU_ABI);
}
Python
def GetDeviceInfo():
DeviceInfoObj = Mobile.Device("MyDevice").DeviceInfo
Log.Message("Device design name: " + DeviceInfoObj.Device)
Log.Message("Device model: " + DeviceInfoObj.Model)
Log.Message("CPU type: " + DeviceInfoObj.CPU_ABI)
VBScript
Sub GetDeviceInfo
Set DeviceInfoObj = Mobile.Device("MyDevice").DeviceInfo
Call Log.Message("Device design name: " & DeviceInfoObj.Device)
Call Log.Message("Device model: " & DeviceInfoObj.Model)
Call Log.Message("CPU type: " & DeviceInfoObj.CPU_ABI)
End Sub
DelphiScript
procedure GetDeviceInfo();
var DeviceInfoObj;
begin
DeviceInfoObj := Mobile.Device('MyDevice').DeviceInfo;
Log.Message('Device design name: ' + DeviceInfoObj.Device);
Log.Message('Device model: ' + DeviceInfoObj.Model);
Log.Message('CPU type: ' + DeviceInfoObj.CPU_ABI);
end;
C++Script, C#Script
function GetDeviceInfo()
{
var DeviceInfoObj = Mobile["Device"]("MyDevice")["DeviceInfo"];
Log["Message"]("Device design name: " + DeviceInfoObj["Device"]);
Log["Message"]("Device model: " + DeviceInfoObj["Model"]);
Log["Message"]("CPU type:" + DeviceInfoObj["CPU_ABI"]);
}
See Also
Testing Android Applications
DeviceInfo Property
iOSDeviceInfo Object