Maintain a connection with GPS satellites
You can configure a
BlackBerry® device application to query the Location API for GPS location information in an interval that is less than 10 seconds.
- Import the following classes:
- javax.microedition.location.Criteria
- javax.microedition.location.LocationProvider
- Import the LocationListener
interface.
- Implement the LocationListener
interface.
- Create an instance of the Criteria class.
Criteria criteria = new Criteria();
- Invoke LocationProvider.getInstance() using the Criteria object as a parameter and assign the value that the method returns to a LocationProvider variable.
LocationProvider provider = LocationProvider.getInstance(criteria);
- Invoke LocationProvider.setLocationListener() to configure a LocationListener with an interval value that is less than 10 seconds.
provider.setLocationListener(loclistener, 9, -1, -1);
Was this information helpful? Send us your comments.