Hi All,
I want to get no of satellites in gps and fix it in my app, for that I've
location listener and Gps Status Listener. so now my requirement is get the
satellites if minimum 5 satellites available then allow the user for
further process in app. Please Let me know and revert back on this.
My code:
i added gpsListener to location manager.
private static final GpsStatus.Listener gpsListener = new
GpsStatus.Listener() {
@Override
public void onGpsStatusChanged(int event) {
switch(event){
case GpsStatus.GPS_EVENT_STARTED:
// Started...
break ;
case GpsStatus.GPS_EVENT_FIRST_FIX:
// First Fix...
break ;
case GpsStatus.GPS_EVENT_STOPPED:
// Stopped...
break ;
case GpsStatus.GPS_EVENT_SATELLITE_STATUS:
GpsStatus status = mLocationManager.getGpsStatus(null);
Log.d("GpsStatus", ""+status);
Iterable<GpsSatellite> sats = status.getSatellites();
Iterator<GpsSatellite>sat = sats.iterator();
int i = 0;
while( sat.hasNext() ) {
GpsSatellite satellite = sat.next();
String strGpsStats = (i++) + ": " +
satellite.getPrn() + "," + satellite.usedInFix() + "," + satellite.getSnr()
+ "," + satellite.getAzimuth() + "," + satellite.getElevation()+ "\n\n";
Log.d("strGpsStats", ""+strGpsStats);
Log.d("no of sat", ""+i);
if(satellite.usedInFix())
{
i++;
Log.d("fixing ", ""+i);
}
}
break;
}
}
};
Let me if any body knows.
Thanks in advance.
Vamshi.
--
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
---
You received this message because you are subscribed to the Google Groups
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.