Blackberry GPS and BlackBerry Maps Manuel - Page 9
Parcourez en ligne ou téléchargez le pdf Manuel pour {nom_de_la_catégorie} Blackberry GPS and BlackBerry Maps. Blackberry GPS and BlackBerry Maps 35 pages. Version: 4.7.0
Development Guide
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.
Getting GPS location information
7