net.rim.device.api.gps
Class GPSInfo

java.lang.Object
  extended by net.rim.device.api.gps.GPSInfo

public class GPSInfo
extends Object

Provides access to device-specific Global Positioning System receiver information. To access this information, the device must be equipped with a GPS receiver.

This class provides the following:

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.7.0

Field Summary
Category: Signed static int GPS_DEVICE_BLUETOOTH
          Indicates a Bluetooth GPS receiver.
Category: Signed static int GPS_DEVICE_INTERNAL
          Indicates an internal GPS receiver.
Category: Signed static int GPS_ERROR_ALMANAC_OUTDATED
          An error status indicating that the almanac is outdated.
Category: Signed static int GPS_ERROR_AUTHENTICATION_FAILURE
          An error status indicating authentication failed with the network.
Category: Signed static int GPS_ERROR_CHIPSET_DEAD
          An error status indicating the GPS chipset is inoperable and a fix cannot be obtained.
Category: Signed static int GPS_ERROR_DEGRADED_FIX_IN_ALLOTTED_TIME
          An error status indicating a degraded GPS fix with poor accuracy.
Category: Signed static int GPS_ERROR_GPS_LOCKED
          An error status indicating that the GPS is locked.
Category: Signed static int GPS_ERROR_INVALID_NETWORK_CREDENTIAL
          An error status indicating invalid network credentials.
Category: Signed static int GPS_ERROR_INVALID_REQUEST
          An error status indicating the GPS fix request is invalid.
Category: Signed static int GPS_ERROR_LOW_BATTERY
          An error status indicating low battery power on the device and a fix cannot be obtained.
Category: Signed static int GPS_ERROR_NETWORK_CONNECTION_FAILURE
          An error status indicating a failure to connect to the data network.
Category: Signed static int GPS_ERROR_NONE
          An error status indicating no GPS error occured.
Category: Signed static int GPS_ERROR_NO_FIX_IN_ALLOTTED_TIME
          An error status indicating no GPS fix can be obtained in the allotted time.
Category: Signed static int GPS_ERROR_NO_SATELLITE_IN_VIEW
          An error status indicating there are no satellites in view, or the signal strength is too low to obtain a fix.
Category: Signed static int GPS_ERROR_PRIVACY_ACCESS_DENIED
          An error status indicating a privacy setting denied access for obtaining a fix.
Category: Signed static int GPS_ERROR_SERVICE_UNAVAILABLE
          An error status indicating that GPS is not available because there is no available cellular service, data service or resources.
Category: Signed static int GPS_ERROR_TIMEOUT_DEGRADED_FIX_NO_ASSIST_DATA
          An error status indicating a degraded fix with poor accuracy and assisted mode could not be used.
Category: Signed static int GPS_ERROR_TIMEOUT_NO_FIX_NO_ASSIST_DATA
          An error status indicating no fix could be obtained in the allotted time, and assisted mode could not be used.
Category: Signed static int GPS_MODE_ASSIST
          Specifies the assisted GPS mode.
Category: Signed static int GPS_MODE_AUTONOMOUS
          Specifies the autonomous GPS mode.
Category: Signed static int GPS_MODE_BT
          Specifies using Bluetooth GPS.
Category: Signed static int GPS_MODE_CDMA_ACCURACY_OPTIMAL
          Specifies the ACCURACY OPTIMAL GPS mode which applies only to devices operating on the CDMA network.
Category: Signed static int GPS_MODE_CDMA_DATA_OPTIMAL
          Specifies the DATA OPTIMAL GPS mode which applies only to devices operating on the CDMA network.
Category: Signed static int GPS_MODE_CDMA_MS_ASSIST
          Specifies the MS-ASSIST GPS mode which applies only to devices operating on the CDMA network.
Category: Signed static int GPS_MODE_CDMA_MS_BASED
          Specifies the MS-BASED GPS mode which applies only to devices operating on the CDMA network.
Category: Signed static int GPS_MODE_CDMA_SPEED_OPTIMAL
          Specifies the SPEED OPTIMAL GPS mode which applies only to devices operating on the CDMA network.
Category: Signed static int GPS_MODE_CELLSITE
          Specifies the cellsite GPS mode.
Category: Signed static int GPS_MODE_NONE
          Specifies no GPS mode.
 
Method Summary
Category: Signed static int getDefaultGPSMode()
          Provides the default GPS mode when GPS Criteria is not specified.
Category: Signed static Enumeration getGPSDataSource()
          Provides a list of GPS data sources.
Category: Signed static int getLastGPSError()
          Returns the last error received when a GPS fix could not be obtained.
Category: Signed static boolean isGPSModeAvailable(int mode)
          Determines whether a given GPS mode is available for use.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 



Field Detail

GPS_ERROR_NONE

public static final int GPS_ERROR_NONE

An error status indicating no GPS error occured.

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.7.0

GPS_ERROR_NO_FIX_IN_ALLOTTED_TIME

public static final int GPS_ERROR_NO_FIX_IN_ALLOTTED_TIME

An error status indicating no GPS fix can be obtained in the allotted time.

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.7.0

GPS_ERROR_DEGRADED_FIX_IN_ALLOTTED_TIME

public static final int GPS_ERROR_DEGRADED_FIX_IN_ALLOTTED_TIME

An error status indicating a degraded GPS fix with poor accuracy.

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.7.0

GPS_ERROR_TIMEOUT_NO_FIX_NO_ASSIST_DATA

public static final int GPS_ERROR_TIMEOUT_NO_FIX_NO_ASSIST_DATA

An error status indicating no fix could be obtained in the allotted time, and assisted mode could not be used.

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.7.0

GPS_ERROR_TIMEOUT_DEGRADED_FIX_NO_ASSIST_DATA

public static final int GPS_ERROR_TIMEOUT_DEGRADED_FIX_NO_ASSIST_DATA

An error status indicating a degraded fix with poor accuracy and assisted mode could not be used.

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.7.0

GPS_ERROR_LOW_BATTERY

public static final int GPS_ERROR_LOW_BATTERY

An error status indicating low battery power on the device and a fix cannot be obtained.

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.7.0

GPS_ERROR_CHIPSET_DEAD

public static final int GPS_ERROR_CHIPSET_DEAD

An error status indicating the GPS chipset is inoperable and a fix cannot be obtained.

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.7.0

GPS_ERROR_INVALID_REQUEST

public static final int GPS_ERROR_INVALID_REQUEST

An error status indicating the GPS fix request is invalid.

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.7.0

GPS_ERROR_PRIVACY_ACCESS_DENIED

public static final int GPS_ERROR_PRIVACY_ACCESS_DENIED

An error status indicating a privacy setting denied access for obtaining a fix.

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.7.0

GPS_ERROR_ALMANAC_OUTDATED

public static final int GPS_ERROR_ALMANAC_OUTDATED

An error status indicating that the almanac is outdated.

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.7.0

GPS_ERROR_SERVICE_UNAVAILABLE

public static final int GPS_ERROR_SERVICE_UNAVAILABLE

An error status indicating that GPS is not available because there is no available cellular service, data service or resources.

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.7.0

GPS_ERROR_GPS_LOCKED

public static final int GPS_ERROR_GPS_LOCKED

An error status indicating that the GPS is locked.

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.7.0

GPS_ERROR_NO_SATELLITE_IN_VIEW

public static final int GPS_ERROR_NO_SATELLITE_IN_VIEW

An error status indicating there are no satellites in view, or the signal strength is too low to obtain a fix.

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.7.0

GPS_ERROR_AUTHENTICATION_FAILURE

public static final int GPS_ERROR_AUTHENTICATION_FAILURE

An error status indicating authentication failed with the network.

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.7.0

GPS_ERROR_NETWORK_CONNECTION_FAILURE

public static final int GPS_ERROR_NETWORK_CONNECTION_FAILURE

An error status indicating a failure to connect to the data network.

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.7.0

GPS_ERROR_INVALID_NETWORK_CREDENTIAL

public static final int GPS_ERROR_INVALID_NETWORK_CREDENTIAL

An error status indicating invalid network credentials.

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.7.0

GPS_MODE_NONE

public static final int GPS_MODE_NONE

Specifies no GPS mode.

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 5.0.0

GPS_MODE_CELLSITE

public static final int GPS_MODE_CELLSITE
Specifies the cellsite GPS mode. If this mode is not supported by the wireless service provider, the optimal geolocation is requested.

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 5.0.0

GPS_MODE_ASSIST

public static final int GPS_MODE_ASSIST

Specifies the assisted GPS mode.

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 5.0.0

GPS_MODE_AUTONOMOUS

public static final int GPS_MODE_AUTONOMOUS

Specifies the autonomous GPS mode.

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 5.0.0

GPS_MODE_CDMA_MS_BASED

public static final int GPS_MODE_CDMA_MS_BASED

Specifies the MS-BASED GPS mode which applies only to devices operating on the CDMA network.

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 5.0.0

GPS_MODE_CDMA_MS_ASSIST

public static final int GPS_MODE_CDMA_MS_ASSIST

Specifies the MS-ASSIST GPS mode which applies only to devices operating on the CDMA network.

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 5.0.0

GPS_MODE_CDMA_DATA_OPTIMAL

public static final int GPS_MODE_CDMA_DATA_OPTIMAL

Specifies the DATA OPTIMAL GPS mode which applies only to devices operating on the CDMA network.

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 5.0.0

GPS_MODE_CDMA_SPEED_OPTIMAL

public static final int GPS_MODE_CDMA_SPEED_OPTIMAL

Specifies the SPEED OPTIMAL GPS mode which applies only to devices operating on the CDMA network.

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 5.0.0

GPS_MODE_CDMA_ACCURACY_OPTIMAL

public static final int GPS_MODE_CDMA_ACCURACY_OPTIMAL

Specifies the ACCURACY OPTIMAL GPS mode which applies only to devices operating on the CDMA network.

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 5.0.0

GPS_MODE_BT

public static final int GPS_MODE_BT

Specifies using Bluetooth GPS.

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 5.0.0

GPS_DEVICE_INTERNAL

public static final int GPS_DEVICE_INTERNAL

Indicates an internal GPS receiver.

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 5.0.0

GPS_DEVICE_BLUETOOTH

public static final int GPS_DEVICE_BLUETOOTH

Indicates a Bluetooth GPS receiver.

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 5.0.0


Method Detail

isGPSModeAvailable

public static boolean isGPSModeAvailable(int mode)
Determines whether a given GPS mode is available for use. If a Bluetooth GPS receiver is used, the GPS mode is irrelevant because all GPS modes are available.

Parameters:
mode - The GPS mode can be one of the following:

GPSInfo.GPS_MODE_CELLSITE
GPSInfo.GPS_MODE_ASSIST
GPSInfo.GPS_MODE_AUTONOMOUS
GPSInfo.GPS_MODE_CDMA_MS_BASED
GPSInfo.GPS_MODE_CDMA_MS_ASSIST
GPSInfo.GPS_MODE_CDMA_SPEED_OPTIMAL
GPSInfo.GPS_MODE_CDMA_ACCURACY_OPTIMAL
GPSInfo.GPS_MODE_CDMA_DATA_OPTIMAL
GPSInfo.GPS_MODE_BT

Returns:
true if the GPS mode is available, false otherwise.
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 5.0.0

getDefaultGPSMode

public static int getDefaultGPSMode()
Provides the default GPS mode when GPS Criteria is not specified. The default GPS mode is determined using the GPS capability supported by the network. The order of preference is Assisted, Autonomous, and then Cellsite. An assisted mode is returned as the default mode only if PDE credentials have been authenticated or are not required.

Returns:
The default GPS mode used. The GPS mode can be one the following:

GPSInfo.GPS_MODE_AUTONOMOUS
GPSInfo.GPS_MODE_ASSIST (or GPSInfo.GPS_MODE_CDMA_MS_BASED if extended CDMA modes are available)
GPSInfo.GPS_MODE_CELLSITE
GPSInfo.GPS_MODE_BT

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 5.0.0

getGPSDataSource

public static Enumeration getGPSDataSource()
Provides a list of GPS data sources.

Returns:
An enumeration of GPS data sources (String). This includes internal GPS receivers and Bluetooth devices (if available). Returns null if there is no GPS data source.
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 5.0.0

getLastGPSError

public static int getLastGPSError()
Returns the last error received when a GPS fix could not be obtained.

Returns:
An error response code.

The error can be one following:

GPSInfo.GPS_ERROR_NONE
GPSInfo.GPS_ERROR_NO_FIX_IN_ALLOTTED_TIME
GPSInfo.GPS_ERROR_DEGRADED_FIX_IN_ALLOTTED_TIME
GPSInfo.GPS_ERROR_TIMEOUT_NO_FIX_NO_ASSIST_DATA
GPSInfo.GPS_ERROR_TIMEOUT_DEGRADED_FIX_NO_ASSIST_DATA
GPSInfo.GPS_ERROR_LOW_BATTERY
GPSInfo.GPS_ERROR_CHIPSET_DEAD
GPSInfo.GPS_ERROR_INVALID_REQUEST
GPSInfo.GPS_ERROR_PRIVACY_ACCESS_DENIED
GPSInfo.GPS_ERROR_ALMANAC_OUTDATED
GPSInfo.GPS_ERROR_SERVICE_UNAVAILABLE
GPSInfo.GPS_ERROR_GPS_LOCKED
GPSInfo.GPS_ERROR_NO_SATELLITE_IN_VIEW
GPSInfo.GPS_ERROR_AUTHENTICATION_FAILURE
GPSInfo.GPS_ERROR_NETWORK_CONNECTION_FAILURE

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.7.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.