What is the best way in Android to get a location provider's status? When registering a LocationListener for location updates, the onStatusChanged(String provider, int status, Bundle extras)
callback will be called whenever the status is changed. However, I didn't find a way for getting the current status (AVAILABLE
, OUT_OF_SERVICE
, TEMPORARILY_UNAVAILABLE
) without registering to location updates. The isProviderEnabled
method just indicates if the provider is generally turned on or not (in the device's settings), so might return true
although the provider is out of service... Is there another way for doing this?
Another question: is it possible to listen for status updates without registering for location updates? I want to listen on a specific provider for locations, but at the same time check if others get available. My current workaround is to set the minimum time and distance to a very high value, but I wonder if there's a better solution...
Thank you for any hints!
Btw: if possible, the solutions should work with Android 1.1