ali_khodayar
چهارشنبه 02 تیر 1395, 12:04 عصر
با سلام خدمت دوستان .
کسی میدونه که چطور میشه تعداد ماهواره در زمان برقراری ارتباط با GPS رو گرفت؟
این کد رو اکثر سایت ها گفتن که استفاده کردن و جواب گرفتن . اما جواب نمیده
public void onGpsStatusChanged() { strGpsStats = "";
GpsStatus gpsStatus = locationManager.getGpsStatus(null);
if(gpsStatus != null) {
Iterable<GpsSatellite>satellites = gpsStatus.getSatellites();
Iterator<GpsSatellite>sat = satellites.iterator();
int i=0;
while (sat.hasNext()) {
GpsSatellite satellite = sat.next();
strGpsStats+= (i++) + ": " + "Pseudo-random number for the satellite: "+satellite.getPrn() + "," + "Satellite was used by the GPS calculation: " + satellite.usedInFix() + "," + "Signal to noise ratio for the satellite: "+satellite.getSnr() + "," + "Azimuth of the satellite in degrees: "+satellite.getAzimuth() + "," +"Elevation of the satellite in degrees: "+satellite.getElevation()+ "\n\n";
}
// Satinfos.setText(strGpsStats);
Toast.makeText(getApplicationContext(), strGpsStats, 100).show();
}
}
در قسمت While شرط هیچوقت بر قرار نیست و وارد نمیشه
لطفأ راهنمایی کنید.
ممنونم .
کسی میدونه که چطور میشه تعداد ماهواره در زمان برقراری ارتباط با GPS رو گرفت؟
این کد رو اکثر سایت ها گفتن که استفاده کردن و جواب گرفتن . اما جواب نمیده
public void onGpsStatusChanged() { strGpsStats = "";
GpsStatus gpsStatus = locationManager.getGpsStatus(null);
if(gpsStatus != null) {
Iterable<GpsSatellite>satellites = gpsStatus.getSatellites();
Iterator<GpsSatellite>sat = satellites.iterator();
int i=0;
while (sat.hasNext()) {
GpsSatellite satellite = sat.next();
strGpsStats+= (i++) + ": " + "Pseudo-random number for the satellite: "+satellite.getPrn() + "," + "Satellite was used by the GPS calculation: " + satellite.usedInFix() + "," + "Signal to noise ratio for the satellite: "+satellite.getSnr() + "," + "Azimuth of the satellite in degrees: "+satellite.getAzimuth() + "," +"Elevation of the satellite in degrees: "+satellite.getElevation()+ "\n\n";
}
// Satinfos.setText(strGpsStats);
Toast.makeText(getApplicationContext(), strGpsStats, 100).show();
}
}
در قسمت While شرط هیچوقت بر قرار نیست و وارد نمیشه
لطفأ راهنمایی کنید.
ممنونم .