This article applies to the following:
The BlackBerry 8130 smartphone, BlackBerry 8330 smartphone and BlackBerry 8830 smartphone use the Qualcomm® gpsOne® chipset. This chip can operate in several modes, some of which are quite different than the modes supported by BlackBerry smartphones operating on the Global System for Mobile communications® (GSM®) network.
This article explains the modes supported by BlackBerry smartphones operating on the Code Division Multiple Access (CDMA) network and the best practices for writing location-based services applications for the Qualcomm gpsOne chip.
Depending on the criteria set by an application, a Qualcomm gpsOne chip can be in any of the following modes:
There are three more modes that use a combination of MS-Based and MS-Assisted to achieve a location fix.
Finally, another mode that simply returns the location of the cellular transmission site in contact with the BlackBerry smartphone is known as CellSite. This mode is not part of Qualcomm gpsOne but is worth mentioning. Accuracy of this mode is obviously low: 400m to 2500m in urban areas and will vary by location. CellSite is recommended when accuracy is of least concern.
Java Specification Request (JSR) 179 and Qualcomm gpsOne
JSR179 (also know as Location application programming interface [API]) includes the necessary APIs to use location-based services capabilities of a BlackBerry smartphone. The most important class in JSR179 is the
Based on the preceding table, the following algorithm is used in the BlackBerry smartphone API implementation:
-if costAllowed = FALSE, mode is standalone
Note: Verizon does not support the Standalone mode. For BlackBerry Device Software 4.7 and later, Standalone mode is open to applications that are signed by Research In Motion.
The following is an example obtaining a
Criteria c = new Criteria();
Location loc = provider.getLocation(100);
This method is strongly recommended when frequent fixes are not required.
2. Implement a
After implementing a
-1 can be passed to use the default value for the interval, maxAge and timeout parameters. The following code demonstrates how to register a LocationListener with default values:
LocationListener locListener = new LocationListenerImpl();
Once a LocationListener is registered, the
As stated in the preceding text, the system automatically updates the state of a LocationProvider by calling the
Setting up PDE information
CDMA wireless service providers usually provide a PDE server which helps the BlackBerry smartphone in obtaining and computing location information.
Note: All Qualcomm gpsOne modes, except StandAlone and Cellsite, require a connection to a PDE server. To enable a connection to a PDE server, the Internet Protocol (IP) address and the port of the server must be configured using
// You must replace these values with values provided by your carrier.
Resetting the LocationProvider
provider.setLocationListener(null, 0, 0, 0);
After a reset, the application can try to get a fix again; however, if the GPS chip fails to get a fix (if the network coverage or environment has not improved), it will again go cold and will stop getting fixes. It is expected that the application will decide when to reset the provider. It is strongly recommended not to reset the provider at an interval less than three minutes since it can take up to three minutes to get a fix from a cold start.
Note: In some BlackBerry Device Software versions, the TEMPORARILY_UNAVAILABLE state was not always triggered as appropriate. In these cases, it is a good practice to keep track of the timestamp of the last valid fix and to reset the provider if the last valid fix is more than three minutes old.
Keeping the GPS chip ‘hot’
The GPS chip is considered ‘hot’ when it has an active connection with the satellites. A fix can be obtained almost instantly when the chip is hot. To preserve battery power, the chip is configured to go cold if the application does not ask for fixes for some time. From a cold start it may take much longer to get a fix. For applications that require frequent fixes, it is recommended that the application queries for fixes every 10 seconds. Therefore, the
Setting up Verizon credentials
Verizon requires third-party applications to have a valid Client ID and Password for their Location Proxy Server (LPS) to access the Location API. To obtain these credentials, contact Verizon. Verizon credentials can be set in an application by calling
A sample application that implements all the recommendations of this article can be found here.