I’ve been playing about with developing a timer application on Android.
One of my beacons starts the timer and another beacon stops it.
I have set the Advertising interval of both beacons to around 200ms. and I have set the scan frequency of the application to do a full scan every one second.
I am currently using the debug tool that stops the beacon transmitting when it is turned over and when I flip over the starting beacon there is about a 5 second delay before the timer starts to run. I then flip the start beacon back over to stop it transmitting and flip the stop beacon the right way up. again there is a 5 second delay before the timer stops running.
It seems to me that the onBeaconsDiscovered() method is running once every 5 seconds which is causing this latency in my app. My understanding is that onBeaconsDiscovered() will run once the app has completed one full scan and wait cycle, which doesn’t seem to be the case here.
I was wondering if you might know what I might be doing wrong ? below is how I’m setting the scanning intervals :
1/ What’s your intent? Ranging or monitoring for beacons?
2/ By default ranging scans for 1000ms and restarts scanning thereafter. That means that onBeaconsDiscovered should be invoked every second even if there are no beacons around. That’s not case for your?
3/ What device/OS you are testing on?
At the minute I’m hoping to use ranging to pick up the beacons, I assumed this would fit my goal better but monitoring might also work.
iv added a line to my code that updates a counter every time the onBeaconsDiscovered methed is called so as far as I can see that method is being called aprox. once every 5 seconds.
I’m testing it on an android device running lollipop.
Let’s focus on that counter in onBeaconsDiscovered that is called ~each 5 seconds.
1/ Method is not invoked on main/UI thread. Are you doing any UI operations? If so please run the code on main thread.
2/ Can you post small snippet of code where you are seeing this behaviour? I’m interested in everything related to Estimote SDK.
I got exactly same issue in some Android devices. Ranging listener is called in 1 second for some devices but in some device it is called after 5 seconds.
Are you using the latest version of the Estimote Android SDK? If not, can you check if it fixes this problem? Also, which devices exactly are affected?
Consider opening a bug report on our Android SDK’s issue tracker: