danger.system
Class Hardware

java.lang.Object
  extended by danger.system.Hardware


public class Hardware
extends Object

Hardware is a class that represents system peripherals


Field Summary
static int DEFAULT_TRACKBALL_SPEED
          Default trackball speed.
static int MAX_TRACKBALL_SPEED
          Maximum trackball speed.
static int MIN_TRACKBALL_SPEED
          Minimum trackball speed.
 
Method Summary
static int getAbsoluteTime()
          Return the number of seconds since boot.
static int getBatteryLevel()
          Deprecated. use danger.system.BatteryMonitor
static int getBatteryState()
          Deprecated. use danger.system.BatteryMonitor
static int getDate()
          Get the date, in seconds since January 1, 2000 12:00am GMT
static String getDeviceID()
          Get the device ID.
static String getDeviceIDType()
          Get the device ID type.
static int getFlashSize()
          XXX: javadoc
static int getHingeRotationCount()
          XXX: javadoc
static int getKeyRepeatDelay()
          XXX: javadoc
static int getKeyRepeatRate()
          XXX: javadoc
static int getLightLevel()
          XXX: javadoc
static int getRAMSize()
          XXX: javadoc
static int getSystemTime()
          return system time in milliseconds -- this may not be directly related to the Date maintained by the realtime clock.
static boolean getTrackballClicksAllowed()
          Get whether trackball clicks are allowed
static int getTrackballHorizontalSpeed()
          Get the trackball horizontal speed.
static int getTrackballVerticalSpeed()
          Get the trackball vertical speed.
static boolean isBacklightOn()
          XXX: javadoc
static boolean isBatteryDoorAttached()
          Get the state of the battery door
static boolean isHingeOpen()
          Determine if the display hinge is open.
static boolean isSIMPresent()
          XXX: javadoc
static boolean isUSBOnline()
          XXX: javadoc
static void setKeyRepeatDelay(int inDelay)
          XXX: javadoc
static void setKeyRepeatRate(int inRate)
          XXX: javadoc
static void setLEDHSV(int hue, int purity, int brightness)
          Set the LED light to the specified color.
static void setLEDRGB(int red, int green, int blue)
          Set the LED light to the specified color.
static void setTrackballClicksAllowed(boolean allow)
          Set whether trackball clicks are allowed
static void setTrackballHorizontalSpeed(int speed)
          Set the trackball vertical speed.
static void setTrackballVerticalSpeed(int speed)
          Set the trackball vertical speed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MIN_TRACKBALL_SPEED

public static final int MIN_TRACKBALL_SPEED

Minimum trackball speed.

For use with setTrackballHorizontalSpeed(int) and setTrackballVerticalSpeed(int).

See Also:
Constant Field Values

MAX_TRACKBALL_SPEED

public static final int MAX_TRACKBALL_SPEED

Maximum trackball speed.

For use with setTrackballHorizontalSpeed(int) and setTrackballVerticalSpeed(int).

See Also:
Constant Field Values

DEFAULT_TRACKBALL_SPEED

public static final int DEFAULT_TRACKBALL_SPEED

Default trackball speed.

For use with setTrackballHorizontalSpeed(int) and setTrackballVerticalSpeed(int).

See Also:
Constant Field Values
Method Detail

isBacklightOn

public static boolean isBacklightOn()
XXX: javadoc


setLEDHSV

public static void setLEDHSV(int hue,
                             int purity,
                             int brightness)
Set the LED light to the specified color.


setLEDRGB

public static void setLEDRGB(int red,
                             int green,
                             int blue)
Set the LED light to the specified color.


getDate

public static int getDate()
Get the date, in seconds since January 1, 2000 12:00am GMT


getSystemTime

public static int getSystemTime()
return system time in milliseconds -- this may not be directly related to the Date maintained by the realtime clock. It will wrap (flip from + to -) every 49.71 hours


getAbsoluteTime

public static int getAbsoluteTime()
Return the number of seconds since boot. Unlike GetSystemTime(), this will advance during sleep and power-off as well.


isHingeOpen

public static boolean isHingeOpen()
Determine if the display hinge is open. Returns true if the hinge is open (the keyboard is visible).


getHingeRotationCount

public static int getHingeRotationCount()
XXX: javadoc


getBatteryLevel

public static int getBatteryLevel()
Deprecated. use danger.system.BatteryMonitor

See how full the battery is.

Returns:
0..1000; 0 is empty, 1000 is full.

getBatteryState

public static int getBatteryState()
Deprecated. use danger.system.BatteryMonitor

See what the battery charger is doing.

Returns:
EventType.BATTERY_* values.

isBatteryDoorAttached

public static boolean isBatteryDoorAttached()
Get the state of the battery door

Returns:
true if battery door is attached, false otherwise

getLightLevel

public static int getLightLevel()
XXX: javadoc


setTrackballVerticalSpeed

public static void setTrackballVerticalSpeed(int speed)
Set the trackball vertical speed.

Parameters:
speed - a value from MIN_TRACKBALL_SPEED to MAX_TRACKBALL_SPEED. The default is DEFAULT_TRACKBALL_SPEED.
Since:
3.0

setTrackballHorizontalSpeed

public static void setTrackballHorizontalSpeed(int speed)
Set the trackball vertical speed.

Parameters:
speed - a value from MIN_TRACKBALL_SPEED to MAX_TRACKBALL_SPEED. The default is DEFAULT_TRACKBALL_SPEED.
Since:
3.0

setTrackballClicksAllowed

public static void setTrackballClicksAllowed(boolean allow)
Set whether trackball clicks are allowed

Since:
3.1

getTrackballHorizontalSpeed

public static int getTrackballHorizontalSpeed()
Get the trackball horizontal speed.

Since:
3.1

getTrackballVerticalSpeed

public static int getTrackballVerticalSpeed()
Get the trackball vertical speed.

Since:
3.1

getTrackballClicksAllowed

public static boolean getTrackballClicksAllowed()
Get whether trackball clicks are allowed

Since:
3.1

getDeviceID

public static String getDeviceID()
Get the device ID.


getDeviceIDType

public static String getDeviceIDType()
Get the device ID type.


isSIMPresent

public static boolean isSIMPresent()
XXX: javadoc


setKeyRepeatRate

public static void setKeyRepeatRate(int inRate)
XXX: javadoc


getKeyRepeatRate

public static int getKeyRepeatRate()
XXX: javadoc


setKeyRepeatDelay

public static void setKeyRepeatDelay(int inDelay)
XXX: javadoc


getKeyRepeatDelay

public static int getKeyRepeatDelay()
XXX: javadoc


isUSBOnline

public static boolean isUSBOnline()
XXX: javadoc


getFlashSize

public static int getFlashSize()
XXX: javadoc


getRAMSize

public static int getRAMSize()
XXX: javadoc