|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.rim.device.api.system.DeviceInfo
public final class DeviceInfo
This class provides access to fundamental information about the host device.
The DeviceInfo class provides access to information on the handheld.
DeviceInfo.getBatteryLevel()
and DeviceInfo.getBatteryStatus()
to retrieve the current level of
battery power, and the battery status.DeviceInfo.getDeviceId()
to retrieve the unique identifier for the handheld.DeviceInfo.getIdleTime()
to determine the number of seconds since the user last used the handheld
keyboard or trackwheel.DeviceInfo.getPlatformVersion()
to retrieve the platform version.
Field Summary | ||
---|---|---|
static int |
BSTAT_AC_CONTACTS
Battery is charging via the AC contacts. |
|
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_LEVEL_CHANGED
The level of the battery has changed, call getBatteryLevel() for detailed info on the Battery Level |
|
static int |
BSTAT_LOW
Battery is low. |
|
static int |
BSTAT_LOW_RATE_CHARGING
Battery is charging, but at a reduced rate. |
|
static int |
BSTAT_NONE
No battery. |
|
static int |
BSTAT_NO_CAMERA_FLASH
Battery is too low for camera flash usage. |
|
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_NO_WLAN
Battery is too low for WLAN radio usage. |
|
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. |
|
static int |
BSTAT_UNKNOWN_BATTERY
Battery is not recognized by the firmware. |
|
static int |
INVALID_DEVICE_ID
Devices with no provisioned PIN (for example, BB-Built-In) shall return the following constant. |
Method Summary | ||
---|---|---|
static boolean |
canResetIdleTime()
Checks whether or not the calling application can reset the device's idle timer. |
|
static int |
getBatteryLevel()
Retrieves the current battery level. |
|
static int |
getBatteryStatus()
Retrieves the battery status. |
|
static int |
getBatteryTemperature()
Retrieves battery's current temperature. |
|
static int |
getBatteryVoltage()
Retrieves battery's current voltage. |
|
static int |
getDeviceId()
Retrieves the PIN number for this device. |
|
static String |
getDeviceName()
Retrieves the current device's product name. |
|
static long |
getIdleTime()
Retrieves the number of seconds since the last key or thumbwheel event. |
|
static int |
getLockTimeout()
Retrieves the device's lock timeout value in seconds. |
|
static String |
getManufacturerName()
Retrieve the device manufacturer's name. |
|
static int |
getOSVersion()
Deprecated. This function attempts to pack the String returned by DeviceInfo.getPlatformVersion() into the format specified above. If it is
unsuccessful, it will return 0. Please use DeviceInfo.getPlatformVersion() instead. |
|
static String |
getPlatformVersion()
Retrieves the platform version. |
|
static String |
getSoftwareVersion()
Retrieves the device's software version. |
|
static int |
getTotalFlashSize()
Deprecated. this method is limited to 2GB, use DeviceInfo.getTotalFlashSizeEx() instead |
|
static long |
getTotalFlashSizeEx()
Retrieves the total flash size of the device. |
|
static boolean |
hasCamera()
Determines if this device has a camera |
|
static boolean |
isBatteryRemovable()
Determines if this device has a removable battery. |
|
static boolean |
isInHolster()
Deprecated. See Sensor.HOLSTER |
|
static boolean |
isPasswordEnabled()
Check if the password is currently enabled on the device. |
|
static boolean |
isSimulator()
Determines if this device is really a simulator. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int BSTAT_DEAD
public static final int BSTAT_TOO_COLD
public static final int BSTAT_TOO_HOT
public static final int BSTAT_LOW
public static final int BSTAT_NONE
public static final int BSTAT_REVERSED
public static final int BSTAT_UNKNOWN_BATTERY
public static final int BSTAT_NO_TURN_ON
public static final int BSTAT_NO_RADIO
public static final int BSTAT_NO_CAMERA_FLASH
public static final int BSTAT_CHARGING
public static final int BSTAT_LOW_RATE_CHARGING
public static final int BSTAT_IS_USING_EXTERNAL_POWER
public static final int BSTAT_LEVEL_CHANGED
public static final int BSTAT_NO_WLAN
public static final int BSTAT_AC_CONTACTS
public static final int INVALID_DEVICE_ID
Method Detail |
---|
public static int getDeviceId()
This method will return the PIN number of a device or the default
value of 0x2100000a
if connected to the simulator. You can
modify the default value associated with the simulator by using the
PIN
command line option.
The PIN command line option takes the form of:
/PIN=<PIN>
where PIN
is the integer value
to be associated with the simulator.
public static int getBatteryLevel()
public static int getBatteryStatus()
public static boolean isBatteryRemovable()
public static int getOSVersion()
DeviceInfo.getPlatformVersion()
into the format specified above. If it is
unsuccessful, it will return 0. Please use DeviceInfo.getPlatformVersion()
instead.
public static String getPlatformVersion()
public static String getSoftwareVersion()
public static boolean isInHolster()
Sensor.HOLSTER
public static int getTotalFlashSize()
DeviceInfo.getTotalFlashSizeEx()
instead
Note that this method returns an integer value that is limited to 2GB. If a BlackBerry handheld has more than 2GB of flash
memory then use DeviceInfo.getTotalFlashSizeEx()
method to get long value.
public static long getTotalFlashSizeEx()
public static long getIdleTime()
public static boolean isSimulator()
public static String getDeviceName()
This method retrieves the current device's product name, with an optional one-letter suffix to distinguish the radio type. For example, GPRS 7130 devices return "7130", while CDMA 7130 devices return "7130e" and UMTS 7130 devices return "7130u".
public static int getBatteryVoltage()
public static int getBatteryTemperature()
public static boolean isPasswordEnabled()
public static String getManufacturerName()
public static boolean hasCamera()
public static boolean canResetIdleTime()
All of the following conditions must be satisfied in order for an application to be able to reset the device's idle timer:
ALLOW_RESET_IDLE_TIMER
must be true. The default is false
for BES users, true
for BIS.
RRT_SIGNER_ID
).
PERMISSION_IDLE_TIMER
application control check.
true
if the calling application can reset the device's idle timer;
false
otherwisepublic static int getLockTimeout()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright 1999-2011 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Java is a trademark of Oracle America Inc. in the US and other countries.
Legal