net.rim.device.api.system
Class Device

java.lang.Object
  extended by net.rim.device.api.system.Device

public final class Device
extends Object

Various utility methods affecting fundamental operation of the Device.

Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 3.6.0

Field Summary
Category: Signed static long DEFAULT_DEVICE_TIME
          The default device time to set, when the device has just been powered up, and the OS has no valid date set.
 
Method Summary
Category: Signed static boolean requestPowerOff(boolean allowAutoOn)
          Requests that the Device power down.
Category: Signed static boolean requestStorageMode()
          Requests that the Device go into storage mode.
Category: Signed static boolean setDateTime(long dateTimeMillis)
          Sets the Device's current date and time.
Category: Signed static void setTimeZone(TimeZone timeZone)
          Sets the device's current time zone.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 



Field Detail

DEFAULT_DEVICE_TIME

public static final long DEFAULT_DEVICE_TIME
The default device time to set, when the device has just been powered up, and the OS has no valid date set.

See Also:
Constant Field Values
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 4.2.0


Method Detail

requestPowerOff

public static boolean requestPowerOff(boolean allowAutoOn)
Requests that the Device power down.

This method may return false if power down is not possible as the serial port is owned by an application. This prevents events such as auto shut-off from shutting the handheld down while it is synchronizing with the desktop.

Parameters:
allowAutoOn - If true, the device can be turned back on automatically by a scheduled application (see ApplicationManager.scheduleApplication(net.rim.device.api.system.ApplicationDescriptor, long, boolean)).
Returns:
True if the power down sequence was started; otherwise false.
Throws:
ControlledAccessException - if the calling application does not have permission to change device settings.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 3.6.0

requestStorageMode

public static boolean requestStorageMode()
Requests that the Device go into storage mode.

Currently, this method always returns true.

Returns:
True.
Throws:
ControlledAccessException - if the calling application does not have permission to change device settings.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 3.6.0

setDateTime

public static boolean setDateTime(long dateTimeMillis)
Sets the Device's current date and time.

The date cannot be earlier than January 1, 2002.

You can retrieve the current date and time by invoking System.currentTimeMillis().

Parameters:
dateTimeMillis - Ticks of desired date since origin time (i.e. midnight UTC, January 1st, 1970).
Returns:
True if the data and time was set successfully; otherwise, false.
Throws:
ControlledAccessException - if the calling application does not have permission to change device settings.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 3.6.0

setTimeZone

public static void setTimeZone(TimeZone timeZone)
Sets the device's current time zone. The list of supported time zones can be retrieved by invoking TimeZoneUtilities.getAvailableTimeZones().

The device's current time zone can be retrieved by invoking TimeZone.getDefault().

Parameters:
timeZone - The device's new time zone.
Throws:
NullPointerException - if timeZone is null.
IllegalArgumentException - if timeZone is not a supported time zone.
ControlledAccessException - if the calling application does not have permission to change device settings.
See Also:
TimeZoneUtilities
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 4.6.0





Copyright 1999-2010 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Copyright 1993-2003 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A. All Rights Reserved.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark of Sun Microsystems, Inc.