0

I'm new with the Google's Fused Location API and I would like to know if there is any way of requesting a location update in any given time?

I know about setInterval() and setFastestInterval() but For example: If the user presses a button, can I get THE current location and not the last known? I just don't want to have the app working at very short intervals to conserve battery.

Thanks

Sanaco
  • 25
  • 6

1 Answers1

1

getLastKnownLocation() only returns the last fix. So if no location providers are being updated the return value of getLastKnownLocation() will not change. The location object will also provide you with accuracy and time of the fix.

I would look at this post for more information. You could use some version of the one shot location.

http://android-developers.blogspot.com/2011/06/deep-dive-into-location.html