Get location information updates
You can associate only one
LocationListener
object with a particular provider for GPS location information. The
BlackBerry® device application typically listens for updates on a separate thread.
1.
Implement the
LocationListener
interface.
2.
To register your implementation, invoke
LocationProvider.setLocationListener()
.
Change the criteria for obtaining location information
1.
Create a new
Criteria
object.
Criteria criteria2 = new Criteria();
2.
Invoke the
setHorizontalAccuracy()
,
setVerticalAccuracy()
,
setCostAllowed()
, and
setPreferredPowerConsumption()
methods of the new
Criteria
object to specify the new criteria.
3.
Invoke
LocationProvider.reset()
.
LocationProvider.reset();
4.
Specify the
LocationListener
to null.
provider.setLocationListener(null, -1, -1, -1);
5.
Invoke
LocationProvider.getInstance()
using the new
Criteria
object as a parameter to create a new
instance of a
LocationProvider
.
provider = LocationProvider.getInstance(criteria2);
6.
Specify the
LocationListener
.
provider.setLocationListener(LocationListener listener, int interval, int
timeout, int maxAge);
Development Guide
Getting GPS location information
8
Содержание GPS and BlackBerry Maps
Страница 1: ...GPS and BlackBerry Maps Version 4 7 0 Development Guide...
Страница 2: ...SWD 596846 1209055709 001...