1

I have to notify the user when the GPS signal is lost (like the Maps app does), but I've searched through the internet and it doesn't seem to exist a way to do it... or I didn't understand it.

Somebody knows how to do it?

I'v tried with GpsStatus.Listener and GpsStatus.NmeaListener but there are no callbacks that point out the loss of GPS connection...

Thanks!

aveschini
  • 1,632
  • 3
  • 22
  • 39

1 Answers1

0

use this code to get no. of sattelite

Location location
int a = location.getExtras().getInt("satellites") ;
if (a > 4) {

}
else {
    singal loss
}
stealthjong
  • 10,858
  • 13
  • 45
  • 84
The Ray of Hope
  • 738
  • 1
  • 6
  • 16
  • Are you sure this can be a solution? How can I have a Location if i have lost signal? – aveschini Jul 08 '14 at 16:34
  • by using locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE); locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER,3000, // 3 sec 5, this); boolean isGPS = locationManager.isProviderEnabled (LocationManager.GPS_PROVIDER); if(!isGPS) { showSettingsAlert(); } – The Ray of Hope Jul 09 '14 at 05:24
  • and implements its method in that write this – The Ray of Hope Jul 09 '14 at 05:24