Retrieving a location provider

After you specify the GPS mode, you must retrieve the location provider that your application uses to support the GPS mode. A location provider represents the source of the location information and it works based on given criteria (for example, the horizontal accuracy and the power usage) .

If the application uses the Criteria class from the JSR 179 package to specify a GPS mode, then the application must retrieve an instance of the LocationProvider class. If the application uses the BlackBerryCriteria class, then the application must retrieve an instance of the BlackBerryLocationProvider class.

A BlackBerryLocationProvider object extends the javax.microedition.location.LocationProvider class. You can use BlackBerryLocationProvider to perform the following actions:

  • Process a location request that you specify in the net.rim.device.api.gps.BlackBerryCriteria object.
  • Pause and resume the location listener.
  • Retrieve the GPS receiver type including an internal or a Bluetooth®enabled GPS receiver.

When the location listener is in a paused state, the application does not receive GPS fixes. The location listener can be in a ready state while also in a paused state.

Was this information helpful? Send us your comments.