3

I want to obtain the number of satellites used in fix but it keeps returning 0.

GpsStatus gps = mlocManager.getGpsStatus(null);
    Iterable<GpsSatellite> sats = gps.getSatellites();
    Iterator satI = sats.iterator();
    int count = 0;
    while(satI.hasNext()){
        GpsSatellite gpssatellite = (GpsSatellite) satI.next();
        if (gpssatellite.usedInFix()){
        count++;
        }
    }

I am using the code in

@Override
    public void onLocationChanged(Location loc)

I know that there is one more question like this on stackoverflow but I tried the code an it still returns 0. I tried on emulator and Nexus S.

0 Answers0