Packageqnx.system
Classpublic class Device
InheritanceDevice Inheritance flash.events.EventDispatcher

The 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

Device.device


Public Properties
 PropertyDefined 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
Public Methods
 MethodDefined 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
Events
 Event Summary Defined By
   Dispatched when a battery level change occurs.Device
   Dispatched when a battery state change occurs.Device
Property Detail
batteryLevelproperty
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.


Implementation
    public function get batteryLevel():int

See also

batteryMonitoringEnabledproperty 
batteryMonitoringEnabled:Boolean

Turns 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.


Implementation
    public function get batteryMonitoringEnabled():Boolean
    public function set batteryMonitoringEnabled(value:Boolean):void

See also

batteryStateproperty 
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:

The default value is DeviceBatteryState.UNKNOWN.


Implementation
    public function get batteryState():int

See also

deviceproperty 
device:Device  [read-only]

Gets a Singleton Device instance.


Implementation
    public static function get device():Device
hardwareIDproperty 
hardwareID:int  [read-only]

Returns the Hardware ID of the device.


Implementation
    public function get hardwareID():int
osproperty 
os:String  [read-only]

Returns the OS of the device.


Implementation
    public function get os():String
pinproperty 
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.


Implementation
    public function get pin():String
scmBundleproperty 
scmBundle:String  [read-only]

Returns the SCM Bundle of the device.


Implementation
    public function get scmBundle():String
serialNumberproperty 
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.


Implementation
    public function get serialNumber():String
vendorIDproperty 
vendorID:uint  [read-only]

Returns the Vendor ID of the device.


Implementation
    public function get vendorID():uint
Constructor Detail
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.

Parameters
enforcer:SingletonEnforcer — Used to prevent calling the constructor directly.

See also

Method Detail
toString()method
override public function toString():String

Returns a String containing device, software, and hardware information.

Returns
String — A String containing device information.
Event Detail
BatteryLevelChange Event
Event Object Type: qnx.events.DeviceBatteryEvent
DeviceBatteryEvent.type property = qnx.events.DeviceBatteryEvent.LEVEL_CHANGE

Dispatched when a battery level change occurs.

See also

BatteryStateChange Event  
Event Object Type: qnx.events.DeviceBatteryEvent
DeviceBatteryEvent.type property = qnx.events.DeviceBatteryEvent.STATE_CHANGE

Dispatched when a battery state change occurs.

See also