Variable location update intervals

Ubername

New member
Would it be possible to change the frequency of location updates based on how far one is from the location? This is simply to conserve whatever resources the location update consumes. So for example if I am >50 km/miles/units from the location, update every 30 minutes, If I am between 49 and 10 units away update every 5 minutes, if I am less than 1 unit away update every 30 seconds?
 

Dm114

Well-known member
Would it be possible to change the frequency of location updates based on how far one is from the location? This is simply to conserve whatever resources the location update consumes. So for example if I am >50 km/miles/units from the location, update every 30 minutes, If I am between 49 and 10 units away update every 5 minutes, if I am less than 1 unit away update every 30 seconds?
Action: Location > Set Location Update Rate

To calculate distance you can use this Action Block:
 

Ubername

New member
I have thought of another way, which may also get around the constraint that the refresh rate can only be configured "system-wide" rather than per location. I can set up geofences with variable circumferences and update the refresh rate as I move from one large circumference to a smaller one. It will take some fiddling with, but I will try it.
 

Ubername

New member
I do not know about the 'fused location' API, but I have manged to confuse myself now! When using a geofence as a trigger, there is an option to set the update rate. I'm not sure how this all interacts with the global update rate setting, and I'm not in a position to test at the moment!
 

md_sgf

Active member
I do not know about the 'fused location' API
The fused location provider is a location API in Google Play services that intelligently combines different signals to provide the location information that your app needs.
What Is Fused Location App On Android?

Final answer:


The Fused Location app on Android utilizes data from GPS, Wi-Fi, and mobile networks to enhance location accuracy and reduce battery consumption for location services.

Explanation:

The Fused Location app on Android is a part of Location Services that provides location information to apps. It combines data from the GPS, Wi-Fi, and mobile networks to provide more accurate location information. By fusing various data sources, it improves location accuracy and reduces the time it takes to get a location fix, thus, saving battery life as it uses less GPS sensor data.

One of the significant advantages of Fused Location is its ability to work indoors, where GPS signals can be weak or non-existent. It's also optimized to use less battery by determining when to use or not use GPS sensors, depending on the requirements of the app requesting location data.
 

md_sgf

Active member
When using a geofence as a trigger, there is an option to set the update rate. I'm not sure how this all interacts with the global update rate setting, and I'm not in a position to test at the moment!
Within the geofence trigger, you can set the global update rate (which changes the default which is in settings). Also the action Set Location Update Rate does this. And settings.

Edit: Within the geofence trigger, you can set the update rate for geofences.
In the action Set Location Update Rate, you can set the global update rate, as well as in Settings .. Trigger Options .. Location Trigger.
 
Last edited:

Wibbly

Active member
Within the geofence trigger, you can set the global update rate (which changes the default which is in settings). Also the action Set Location Update Rate does this. And settings.
I thought the update rate was only for location. Google Play Services completely controls Geofence updates as that uses the fused location API.

But I do see there's an update period in the Geofence trigger config ... Wiki says

  • Location Update Rate
This is just guidance for the Play Services library advising it how often you would like to check for location updates. The library will take this into consideration when deciding to check for Geofences but updates may vary considerably from the requested time.
 
Last edited:

Wibbly

Active member
My guess is they are different. Location update rate drives the internal MD algorithm for the local/internal-only location service. Geofence update rate is just something fed to Google as a 'guidance' update rate that Google Play Services ultimately controls.

Not sure about the bug. Maybe raise it as a bug possibility from the app?
 

md_sgf

Active member
Not sure about the bug. Maybe raise it as a bug possibility from the app?
No, it's not a bug. The Set Location Update Rate sets the update rate only. It doesn't show what current rate is. I'm not sure how to fetch that. I couldn't find any such magic text.
It affects the update value as seen in settings. But altering the value (via settings or Set Location Update Rate action) does not alter the action, as it is a constant set by user (is what want update value to be, not what it currently is). I hope that makes sense.
 
Top