| Package | qnx.system |
| Class | public class Device |
| Inheritance | Device flash.events.EventDispatcher |
Device class exposes many properties of the device. Use the public static method
Device.device to retrieve a reference to the current device.
See also
| Property | Defined By | ||
|---|---|---|---|
| batteryLevel : int [read-only]
Returns the battery level of the device. | Device | ||
| batteryMonitoringEnabled : Boolean
Turns battery monitoring on or off. | Device | ||
| batteryState : int [read-only]
Returns the battery state of the device. | Device | ||
| device : Device [static] [read-only]
Gets a Singleton Device instance. | Device | ||
| hardwareID : int [read-only]
Returns the Hardware ID of the device. | Device | ||
| os : String [read-only]
Returns the OS of the device. | Device | ||
| pin : String [read-only]
Returns the PIN of the device. | Device | ||
| scmBundle : String [read-only]
Returns the SCM Bundle of the device. | Device | ||
| serialNumber : String [read-only]
Returns the serial number of the device. | Device | ||
| vendorID : uint [read-only]
Returns the Vendor ID of the device. | Device | ||
| Method | Defined By | ||
|---|---|---|---|
Device(enforcer:SingletonEnforcer)
Do not use the constructor to instanitate a instance of this class. | Device | ||
toString():String [override]
Returns a String containing device, software, and hardware information. | Device | ||
| Event | Summary | Defined By | ||
|---|---|---|---|---|
| Dispatched when a battery level change occurs. | Device | |||
| Dispatched when a battery state change occurs. | Device | |||
| batteryLevel | property |
batteryLevel:int [read-only] Returns the battery level of the device.
If the batteryMonitoringEnabled property is set to true, a value between 0 and 100 will be returned
indicating the battery level.
If the batteryMonitoringEnabled property is set to false, -1 is returned indicating that the battery level is unknown.
The default value is -1.
public function get batteryLevel():intSee also
| batteryMonitoringEnabled | property |
batteryMonitoringEnabled:BooleanTurns battery monitoring on or off.
When set to true, DeviceBatteryEvent.LEVEL_CHANGE and DeviceBatteryEvent.STATE_CHANGE events will be
dispatched whenever changes to the battery level and state occur.
When set to false, events will not be fired.
The default value is false.
public function get batteryMonitoringEnabled():Boolean public function set batteryMonitoringEnabled(value:Boolean):voidSee also
| batteryState | property |
batteryState:int [read-only] Returns the battery state of the device.
If the batteryMonitoringEnabled property is set to false, DeviceBatteryState.UNKNOWN is returned as the state is unknown.
If the batteryMonitoringEnabled property is set to true, the battery state will be returned.
The following are valid values:
DeviceBatteryState.UNKNOWNDeviceBatteryState.FULLDeviceBatteryState.CHARGINGDeviceBatteryState.UNPLUGGED The default value is DeviceBatteryState.UNKNOWN.
public function get batteryState():intSee also
| device | property |
device:Device [read-only]
Gets a Singleton Device instance.
public static function get device():Device| hardwareID | property |
hardwareID:int [read-only] Returns the Hardware ID of the device.
public function get hardwareID():int| os | property |
os:String [read-only] Returns the OS of the device.
public function get os():String| pin | property |
pin:String [read-only] Returns the PIN of the device.
In order to access this property, you must set the read_device_identifying_information permission attribute for your application. See the BlackBerry Tablet OS Developer's Guide for more information.
public function get pin():String| scmBundle | property |
scmBundle:String [read-only] Returns the SCM Bundle of the device.
public function get scmBundle():String| serialNumber | property |
serialNumber:String [read-only] Returns the serial number of the device.
In order to access this property, you must set the read_device_identifying_information permission attribute for your application. See the BlackBerry Tablet OS Developer's Guide for more information.
public function get serialNumber():String| vendorID | property |
vendorID:uint [read-only] Returns the Vendor ID of the device.
public function get vendorID():uint| Device | () | Constructor |
public function Device(enforcer:SingletonEnforcer)
Do not use the constructor to instanitate a instance of this class.
Use the Device.device method to return the Singleton instance of the class.
enforcer:SingletonEnforcer — Used to prevent calling the constructor directly.
|
See also
| toString | () | method |
override public function toString():String
Returns a String containing device, software, and hardware information.
String — A String containing device information.
|
| BatteryLevelChange | Event |
qnx.events.DeviceBatteryEventqnx.events.DeviceBatteryEvent.LEVEL_CHANGEDispatched when a battery level change occurs.
See also
| BatteryStateChange | Event |
qnx.events.DeviceBatteryEventqnx.events.DeviceBatteryEvent.STATE_CHANGEDispatched when a battery state change occurs.
See also