1

I've created a service implementing LocationManager. I have a question though.

Let's say I ask for a location update, but the user can't get any GPS connection where he/she is. In order to save battery life, how to define I would like the app to look for location datas for example 60 sec? If a location is found below 60 sec, it is signified to the user and if the 60 sec limit is reached, it will be signified to the user.

MademoiselleLenore
  • 569
  • 1
  • 10
  • 25

1 Answers1

1

When you call requestForLocationUpdates() - start a 60 second Timer.

In case onLocationChanged() is not called on completion of this Timer - you perhaps Toast


  • Here is a better way to check if a proper position fix is attained
  • In the absence of a data connection please consider running the timer longer as SUPL fails.
Community
  • 1
  • 1
Reno
  • 33,594
  • 11
  • 89
  • 102