net.rim.device.api.system
Class DeviceInfo

java.lang.Object
  |
  +--net.rim.device.api.system.DeviceInfo

public final class DeviceInfo
extends Object

This class provides access to fundamental information about the host device.


Field Summary
static int BSTAT_CHARGING
          Battery is charging.
static int BSTAT_DEAD
          Battery at or below zero percent.
static int BSTAT_IS_USING_EXTERNAL_POWER
          Device is connected to an external power source.
static int BSTAT_LOW
          Battery is low.
static int BSTAT_NO_RADIO
          Battery is too low for radio usage.
static int BSTAT_NO_TURN_ON
          Battery is too low for device to turn on.
static int BSTAT_NONE
          No battery.
static int BSTAT_REVERSED
          Battery is inserted backwards.
static int BSTAT_TOO_COLD
          Battery is too cold.
static int BSTAT_TOO_HOT
          Battery is too hot.
 
Method Summary
static int getBatteryLevel()
          Retrives the current battery level.
static int getBatteryStatus()
          Retrieves the battery status.
static int getDeviceId()
          Retrieves the unique identifier for this device.
static long getIdleTime()
          Retrieves the number of seconds since the last key or thumbwheel event.
static int getOSVersion()
          Retrieves the OS version.
static boolean isBatteryRemovable()
          Determines if the device has a removable battery.
static boolean isInHolster()
          Determines if the device is in the holster.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BSTAT_DEAD

public static final int BSTAT_DEAD
Battery at or below zero percent.

BSTAT_TOO_COLD

public static final int BSTAT_TOO_COLD
Battery is too cold.

BSTAT_TOO_HOT

public static final int BSTAT_TOO_HOT
Battery is too hot.

BSTAT_LOW

public static final int BSTAT_LOW
Battery is low.

BSTAT_NONE

public static final int BSTAT_NONE
No battery.

BSTAT_REVERSED

public static final int BSTAT_REVERSED
Battery is inserted backwards.

BSTAT_NO_TURN_ON

public static final int BSTAT_NO_TURN_ON
Battery is too low for device to turn on.

BSTAT_NO_RADIO

public static final int BSTAT_NO_RADIO
Battery is too low for radio usage.

BSTAT_CHARGING

public static final int BSTAT_CHARGING
Battery is charging.

BSTAT_IS_USING_EXTERNAL_POWER

public static final int BSTAT_IS_USING_EXTERNAL_POWER
Device is connected to an external power source.
Method Detail

getDeviceId

public static int getDeviceId()
Retrieves the unique identifier for this device.

Returns:
Unique ID for this device.

getBatteryLevel

public static int getBatteryLevel()
Retrives the current battery level.

Returns:
Percentage of maximum battery level remaining.

getBatteryStatus

public static int getBatteryStatus()
Retrieves the battery status.

Returns:
Combination of the BSTAT_xxx masks from this class.

isBatteryRemovable

public static boolean isBatteryRemovable()
Determines if the device has a removable battery.

Returns:
True if the device has removable battery.

getOSVersion

public static int getOSVersion()
Retrieves the OS version.

Returns:
OS version in a 4 byte packet. You should interpret this value on a per-byte basis. Thus, read the returned integeer 33557790 as 0x02 00 0D 1E in hex, which is 2.0.13.30 in decimal.

isInHolster

public static boolean isInHolster()
Determines if the device is in the holster.

Returns:
True if the device is in the holster; otherwise, false.

getIdleTime

public static long getIdleTime()
Retrieves the number of seconds since the last key or thumbwheel event.

Returns:
Seconds since last key or thumbwheel event.


Copyright 1999-2002 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Copyright 1993-2000 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A. All Rights Reserved.
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.