How to reset Proximity Zone Context

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:

  1. Stop the observer.
  2. Programmatically disable Bluetooth via BluetoothAdapter.disable
  3. Wait till it’s off.
  4. Programmatically enable Bluetooth via BluetoothAdapter.enable
  5. Wait till it’s on.
  6. 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.