Difference between LocationRequest setInterval (long millis) and LocationRequest setFastestInterval (long millis)

Based on the relevant Android documentation:

  • setInterval(long) means – set the interval in which you want to get locations.
  • setFastestInterval(long) means – if a location is available sooner you can get it (i.e. another app is using the location services).

For example, you start your application and register it via setInterval(60*1000), that means that you’ll get updates every 60 seconds.

Now you call setFastestInterval(10*1000). If you are the only app which use the location services you will continue to receive updates approximately every 60 seconds. If another app is using the location services with a higher rate of updates, you will get more location updates (but no more frequently that every 10 seconds).

I believe that it has a good impact on battery life consumed by your app, you define the maximum amount of time that you can wait while saying that if an update is available, you want it. The battery consumption will be credited to the app which requested the more frequent updates and not yours.

Leave a Comment