Android: Location update frequency
Hello,
firstly, I want to thank you for implementing such a sophisticated and useful library, good job.
We consider buying license for Android, but could not get it to work as we need. I hope you can help us.
Just to clarify, the purpose of application we develop is to track someone's positions while he is jogging or biking, so we can display the path he has traveled on the map. That means, the faster we get new locations, the better (regardless of the battery consumption, at least for now).
The problem is, the refresh rate of location change event is always 10 or 11 seconds. Received locations' timestamp is always XX:YY:ZZ.000 (or .999,.001) , which is very deterministic, so i believe the frequency is being influenced by your module somehow. We also tried to use exactly the same config as your demo application uses, with no effect. It looks like config is ignored - is that because of missing license?
By the way, I am testing your module for 3rd day now, so I think I am aware of the module states etc. I always call .start() and then .changePace(true) to avoid stationary mode completely, dont need it.
Thanks in advance
Your Environment
- Plugin version: 2.8.4
- Platform: Android
- OS version: 6.0.1
- Device manufacturer / model: Samsung Galaxy A3 2016 (SM-A310F)
- React Native version (
react-native -v): 0.42.3
Expected Behavior
Location is updated according to config => distance-based update
Actual Behavior
IT SEEMS location updates are time-based, the weird behavior is described above
Steps to Reproduce
code is here
- press START (calls
bgGeo.start()) - press MOVING (calls
bgGeo.changePace(true)) - start walking outside, so you get some location updates
Show me your config
BackgroundGeolocation.configure({
enabled: false,
desiredAccuracy: BackgroundGeolocation.DESIRED_ACCURACY_HIGH,
debug: true,
})
as simple as that..
Read the docs for distanceFilter
And use logLevel: BackgroundGeolocation.LOG_LEVEL_VERBOSE while developing.
BackgroundGeolocation.configure({
enabled: false,
desiredAccuracy: BackgroundGeolocation.DESIRED_ACCURACY_HIGH,
debug: true,
logLevel: BackgroundGeolocation.LOG_LEVEL_VERBOSE,
disableElasticity: true,
distanceFilter: 1
})
This means new location will be given if its at least 1m different from the previous one, am I right? Received locations with these timestamps:
15:44:02.182
15:44:12:000
15:44:22:000
15:44:33:000
15:44:43:000
15:44:54:000
I have no idea how you're testing or what platform you're talking about (iOS or Android).
Are you observing the logs?
The issue template is helpful. Please don't ignore it in the future.
Your Environment
- Plugin version:
- Platform: iOS or Android
- OS version:
- Device manufacturer / model:
- React Native version (
react-native -v): - Plugin config
Expected Behavior
Actual Behavior
Steps to Reproduce
1. 2. 3. 4.
Context
Debug logs
I've just asked you 3 questions which are asked in the template:
- Config
- Platform
- Logs.
Sorry, could not find the template :/ You can check my code here, if it helps... I check the logs of course, but have no idea, what to search for.
The template is there whenever you create a new issue. You deleted the text.
How are you testing?
What do you mean?
I call .start(), then i call .changePace(true) via buttons and then i go outside to walk a bit with the PHYSICAL device, watching its screen :D
Tested on another device right now, with exactly same result..
set fastestLocationUpdateInterval: 0, distaneFilter: 0
Wow Chris, thank you alot!!!
I didnt notice fastestLocationUpdateInterval is set to 10000ms by default. It seems everything works right now. Consider changing it to 0ms by default. Its the FASTEST, not the ACTUAL one.
In your demo app, fastestLocationUpdateInterval is set to 10000ms also, but the location is updated much more often.