For example, I am inside a building and i want to get my location with the accuracy of 0.75 (Criteria.ACCURACY_FINE) and this will use the gps if my gps is on. Since I am inside a building, gps won’t work.
How can I determine if it is really impossible to get a gps fix location?
Is onLocationChanged(Location arg0) will be called even though no gps fix location was received when using LocationListener?
Is it possible to use a timeout in requesting gps location so that I can shift to network as the location provider if i can’t get any location?
I see three basic possibilities:
determine it based upon calls to
onStatusChanged. My concern here is
that I’m not sure how well android
is able to determine the difference
between OUT_OF_SERVICE and
TEMPORARILY_UNAVAILABLE. I would
hope that its based upon signal
strength, but its probably something
to test.
heard from the (more accurate) gps provider
in a certain period of time, then switch to the
less reliable approaches. This may consume more power
due to the requirement to monitor multiple location sources
simultaneously, but is probably the most reliable method otherwise.