Get the course of the BlackBerry device, in degrees
Invoke
location.getCourse()
.
Location location = provider.getLocation(-1);
float course = mylocation.getCourse();
Get the number of GPS satellites that a BlackBerry device tracks
1.
Invoke the
Location.getExtraInfo()
method using the NMEA MIME type as a parameter. The method returns
an encoded
String
that contains information on the number of GPS satellites.
Location location = provider.getLocation(-1);
String encodedStr = mylocation.getExtraInfo("application/X-jsr179-
location-nmea");
2.
To retrieve the GPS satellite information, parse through the information in the returned
String
value.
Get the time that a BlackBerry device application retrieved GPS information
Invoke
Location.getTimeStamp()
. The time is retrieved from the GPS receiver on the BlackBerry® device.
Location location = provider.getLocation(-1);
myLocation.getTimeStamp();
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 less
than 10 seconds.
Define a
LocationListener
with an interval value that is less than 10 seconds.
LocationProvider provider = LocationProvider.getInstance(criteria);
provider.setLocationListener(loclistener, 9, -1, -1);
Get continuous GPS readings using the cell site mode
Invoke the
LocationProvider.getLocation()
method within code that simulates the retrieval of GPS
information at fixed intervals.
Get GPS information during a call
Use the autonomous mode to retrieve GPS information.
Development Guide
Getting GPS location information
7