Is it possible to reset the zone context with the Proximity SDK without having to stop and re-start my Proximity observer? The reason I want to do this is mainly for testing purposes where I need to restart the beacon logic relatively often. The problem with stopping and re-starting the observer is this “feature” of Android that causes the observer to silently fail in the background. So now I find myself implementing all kinds of logic to work around the issue that is essentially mainly a problem during testing.
The best workaround I can think of is, if you only need this for testing:
- Stop the observer.
- Programmatically disable Bluetooth via
BluetoothAdapter.disable
- Wait till it’s off.
- Programmatically enable Bluetooth via
BluetoothAdapter.enable
- Wait till it’s on.
- Start the observer.
Basically, I believe power-cycling Bluetooth should also clear the 30-second limit for starting/stopping Bluetooth LE scanning, allowing you to re-start the Proximity Observer sooner than once every 30 seconds.
A little hacky, but should get the job done in the absence of a way to “reset” proximity zones.
Ok. Thank you Piotr.