onaio/kujaku

Handle null locations on getLastLocation and remove stale last locations

ekigamba opened this issue · 5 comments

This seems that it can happen on rare occasions
https://developer.android.com/training/location/retrieve-current#java

  • Handle null locations after calling getLastLocation on the FusedLocationClient
  • Reset lastLocation to null if the location services or location on the device has been turned off
  • Improve last location and location updates accuracy and suitability by using the algorithm provided by google https://developer.android.com/guide/topics/location/strategies#BestEstimate
  • To be able to save battery, once an accurate location have been retrieved. Can the Geowidget support a way for the host app to reduce the frequency of updates? This will be configurable after the initial default setup of update intervals to support throttling down update requests with an aim to reduce on power consumption

As requested by @githengi

To be able to save battery, once an accurate location have been retrieved. Can the Geowidget support a way for the host app to increase the frequency of updates.

https://developer.android.com/guide/topics/location/strategies#set-the-location-providers-to-return-updates-less-frequently

You mean decrease the frequency of updates?

Yes

Should we do that out-of-the-box or should that be something that is configurable by a host application if it wants that? I am thinking of a standard way to do that. I do not know if this should be the standard out-of-the-box?

Can you also provide the numbers in terms of updateIntervals that you are thinking about?

This should be configurable in the host application. The host application should be able to setup updateIntervals