I\'m using a GPS provider and LocationListener.onLocationChanged(Location location) to receive location fixes.
Documentation says, that Location.getExtras() contains nex
I use Location.getExtras().getInt("satellites"), and it give the number of satellites in use.
Nope it means that your phone manufacturer decided not to implement this. (Or you could be using the NETWORK_PROVIDER
which does not use satellites)
Use a NmeaListener and parse the sentences to know the number of satellites visible or used.
To get the number of satellites used by the GPS engine you need to implement android.location.GpsStatus.Listener
and implement its method onGpsStatusChanged()
.
Example...
public void onGpsStatusChanged(int event) {
int satellites = 0;
int satellitesInFix = 0;
int timetofix = locationManager.getGpsStatus(null).getTimeToFirstFix();
Log.i(TAG, "Time to first fix = " + timetofix);
for (GpsSatellite sat : locationManager.getGpsStatus(null).getSatellites()) {
if(sat.usedInFix()) {
satellitesInFix++;
}
satellites++;
}
Log.i(TAG, satellites + " Used In Last Fix ("+satellitesInFix+")");
}