qnx.system.Device

Device

Properties | Methods | Events


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.

Class information:
PlayBook Tablet OS Version:   1.0.6

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

batteryLevel


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

batteryMonitoringEnabled

batteryMonitoringEnabled


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

DeviceBatteryState

batteryState


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.UNKNOWN
  • DeviceBatteryState.FULL
  • DeviceBatteryState.CHARGING
  • DeviceBatteryState.UNPLUGGED

The default value is DeviceBatteryState.UNKNOWN.


Implementation

public function get batteryState():int

See also

DeviceBatteryState
batteryMonitoringEnabled

device


device:Device  [read-only]

Gets a Singleton Device instance.


Implementation

public static function get device():Device

hardwareID


hardwareID:int  [read-only]

Returns the Hardware ID of the device.


Implementation

public function get hardwareID():int

os


os:String  [read-only]

Returns the OS of the device.


Implementation

public function get os():String

pin


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

scmBundle


scmBundle:String  [read-only]

Returns the SCM Bundle of the device.


Implementation

public function get scmBundle():String

serialNumber


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

vendorID


vendorID:uint  [read-only]

Returns the Vendor ID of the device.


Implementation

public function get vendorID():uint

Constructor Detail

Device()


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

device

Method Detail

toString()


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 Object Type: qnx.events.DeviceBatteryEvent
DeviceBatteryEvent.type property = qnx.events.DeviceBatteryEvent.LEVEL_CHANGE

Dispatched when a battery level change occurs.

See also

batteryLevel

BatteryStateChange


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

Dispatched when a battery state change occurs.

See also

DeviceBatteryState
batteryState