My android app shows an alert when a user enters a region, and another alert when the user exits a region. There are three separate regions with one beacon each. The enter events are triggered very fast when you come into range of a beacon. However, the exit events seem to have a delay of at least 15 seconds.
I understand that there is a default delay to protect from false positive exit events, so I used beaconManager.setBackgroundScanPeriod(15000,1000), and beaconManager.setRegionExitExpiration(1000), (note: I am passing java Longs for the time as required) however there is still a delay of about 15 seconds after exiting a region before the alert is displayed.
Am I doing something wrong, or is it not possible to trigger the onExitedRegion function any faster?
I tried the same thing, but it seems that you can’t receive exit events under this 15 seconds guard-time…
Maybe I did something wrong too ^^
I can confirm - we have a bug here in recent SDK versions. It forces SDK to always use default 20s timeout before triggering onExitEvent.
We working hard to solve the issue. Fix should be available in upcoming SDK version - stay tuned
New SDK version is ready to be downloaded:
Check it out and let us know if fix works as expected.
it works not as expected.
I’ve tried setRegionExitExpiration(60000) and setRegionExitExpiration(1000), but
it is always set to 20000=20s.
heh… like always - “strange, it works for me”
We’ll investigate it further - stay tuned
I’ve tried it on Android 5.0.1 and 5.1 devices.
Hey, it works for me, when I put:
// Set the monitoring settings.
// Set the exit expiration to it's min (between 1000 and 60000 in ms).
The exit notification came with 1 second delay
here is my code:
and it don’t work.
Are you using background or foreground scanning?
foreground, that why I use:
Discovery is always foreground.
Android SDK - Basic concepts
I think what you wrote is wrong, because:
setForegroundScanPeriod() is used for ranging (see the JavaDoc),
setRegionExitExpiration is for monitoring
I only use Discovery, cause I use EddystoneListener.
Yes, but, why is a beacon there and the app gets data from sdk, although I removed batteries, and the data is received for exactly 20s.
In 0.16.0 it worked fine
OK, so you want to change the scanning period of the
ConfigurableDevice scanner, don’t you?
The doc’ doesn’t seems to demonstrate how to do this…
Just to @Wojciech_Wawerek, the monitoring
setRegionExitExpiration is working well on 1.0.13
if you say, that setRegionExitExpiration is for monitoring onExitRegion call.
Why is onEddystoneFound invoked although the beacon has no power supply (batteries are removed) and put out the namespace and instance of the beacon (Eddystone), so I can be sure, that is the beacon I had on my desk.
It’s quite obvious that no, but maybe another beacon is active near you…
no, I use EddystoneListener. and I start it with beaconManager.startEddystoneDiscovery().
The problem is:
- beacon batteries are removed
- earlier there was no eddystone packet received after 1 second (sdk 0.16.0)
- now I get eddystone packets for 20s, but no other beacons are there, only one beacon! (sdk 1.0.12+)