net.rim.device.api.gps
Class BlackBerryLocationProvider

java.lang.Object
  extended by javax.microedition.location.LocationProvider
      extended by net.rim.device.api.gps.BlackBerryLocationProvider

public abstract class BlackBerryLocationProvider
extends LocationProvider

This is the starting point for applications using the JSR179 Extension API. A BlackBerryLocationProvider is an extension of the LocationProvider class in the JSR179 API. This extension allows an application to do the following:

1. Processes a location request as specified in the BlackBerryCriteria object.

2. Pause and resume the location listener. In this state the application will not receive any more GPS fix. In the pause state, the application can specify that it wants the implementation to keep the GPS warm.

3. Get the GPS provider type, internal or Bluetooth GPS.

Since:
BlackBerry API 5.0.0

Field Summary
static int PAUSED
          Availability status code: the location provider is paused.
 
Fields inherited from class javax.microedition.location.LocationProvider
AVAILABLE, OUT_OF_SERVICE, TEMPORARILY_UNAVAILABLE
 
Method Summary
 int getProviderType()
          This method returns the type of provider being used
 void pauseLocationTracking(int interval)
          This method allows the application to pause the location tracking.
 void resumeLocationTracking()
          This method allows an application to resume the location tracking.
 void stopLocationTracking()
          This method allows an application to stop the location tracking.
 
Methods inherited from class javax.microedition.location.LocationProvider
addProximityListener, getInstance, getLastKnownLocation, getLocation, getState, removeProximityListener, reset, setLocationListener
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 



Field Detail

PAUSED

public static final int PAUSED

Availability status code: the location provider is paused.

See Also:
Constant Field Values
Since:
BlackBerry API 5.0.0


Method Detail

pauseLocationTracking

public void pauseLocationTracking(int interval)
This method allows the application to pause the location tracking. The application will not receive any GPS fix in this state.

Parameters:
interval - - use to keep the GPS warm for the application. A value of 0 means that the GPS will not be kept warm. A value greater than 0 will trigger the GPS to wake up at the interval specified.
Since:
BlackBerry API 5.0.0

resumeLocationTracking

public void resumeLocationTracking()
This method allows an application to resume the location tracking. This will have an effect only if the application had made a prior request to pause the location tracking.

Since:
BlackBerry API 5.0.0

stopLocationTracking

public void stopLocationTracking()
This method allows an application to stop the location tracking. This will have an effect only if the application had made a prior request to start the location tracking.

Invoking stopLocationTracking() will stop and clear the tracking session. To restart the location tracking session using the same location provider, the application must invoke reset() and then add a new listener to the location provider.

Since:
BlackBerry API 5.0.0

getProviderType

public int getProviderType()
This method returns the type of provider being used

Returns:
either GPSInfo.GPS_DEVICE_INTERNAL or GPSINfo.GPS_DEVICE_BLUETOOTH
Since:
BlackBerry API 5.0.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.