Ok, so let's try a combination of all the answers and updates so far and do something like this:
ACCESS_FINE_LOCATION
permission to your manifestLocationManager
GpsStatus.Listener
that reacts to GPS_EVENT_SATELLITE_STATUS
LocationManager
with addGpsStatusListener
The GPS listener could be something like this:
GpsStatus.Listener listener = new GpsStatus.Listener() {
void onGpsStatusChanged(int event) {
if (event == GPS_EVENT_SATELLITE_STATUS) {
GpsStatus status = mLocManager.getGpsStatus(null);
Iterable<GpsSatellite> sats = status.getSatellites();
// Check number of satellites in list to determine fix state
}
}
}
The APIs are a bit unclear about when and what GPS and satellite information is given, but I think an idea would be to look at how many satellites are available. If it's below three, then you can't have a fix. If it's more, then you should have a fix.
Trial and error is probably the way to go to determine how often Android reports satellite info, and what info each GpsSatellite
object contains.