Different intervals between iOS and Android devices
Opened this issue · 2 comments
We're currently using the cordova-background-geolocation-services plugin within OutSystems (https://www.outsystems.com/forge/component/1623/background-location-plugin/). So far this is working out well for us, however on Android devices we see different behaviour when compared to iOS devices. On iOS devices intervals are happening every 900 seconds, on several tested Android devices the intervals range between 0 and approx. 400 seconds. Furthermore when an Android device is not being used for a longer period (for example during nighttime) intervals are about 15000 seconds.
I've traced this down to the configure block which takes several parameters ($parameters being the name of global variables being passed to this block of code):
//Configure Plugin
window.plugins.backgroundLocationServices.configure({
//Both
desiredAccuracy: $parameters.desiredAccuracy, // Desired Accuracy of the location updates (lower means more accurate but more battery consumption)
distanceFilter: $parameters.distanceFilter, // (Meters) How far you must move from the last point to trigger a location update
debug: $parameters.debug, // <-- Enable to show visual indications when you receive a background location update
interval: $parameters.interval, // (Milliseconds) Requested Interval in between location updates.
useActivityDetection: $parameters.useActivityDetection, // Uses Activitiy detection to shut off gps when you are still (Greatly enhances Battery Life)
//Android Only
notificationTitle: $parameters.notificationTitle, // customize the title of the notification
notificationText: $parameters.notificationText, //customize the text of the notification
fastestInterval:$parameters.fastestInterval // <-- (Milliseconds) Fastest interval your app / server can handle updates
});
interval has a value of 900000 / 60000 (= 15 min / 1 min)
useActivityDetection has a value of False (always)
distanceFilter has a value of 5 / 1
fastestInterval has a value of (same as interval)
If above needs to be clarified I'm willing to provide more details. Thanks in advance for any help provided.
Some additional information in addition to above:
- We use the cordova-background-geolocation-services as a plugin in the OutSystems environment
- We have seen this behaviour on different Android devices using OS 7 or 8.
If any help can be provided on this issue it would be appreciated.
Just a clarification/updated description: Within our OutSystems application we are using the cordova-background- geolocation-services-plugin. This works well on iOS, where we see a mostly regular interval of 15 minutes between each location update.
However, on Android devices we see different behavior. Here the location updates:
- Are between 0 and approx. 1000 seconds.
- Only happens when a device is being moved
- Do not take place at longer periods of inactivity on the device
We use the following configuration values:
Android and iOS:
- desiredAccuracy: 0
- distanceFilter: 5
- debug: False
- interval: 900000
- useActivityDetection: False
Android only:
- notificationTitle: "Background Location Services"
- notificationText: "Tracking"
- fastestInterval: 900000
If possible, any help on explaining the erratic behavior on Android would be appreciated.