AltBeacon / android-beacon-library

Allows Android apps to interact with BLE beacons
Apache License 2.0
2.84k stars 836 forks source link

RegionBootstrap: How to prevent any running ScanJob while app is in foreground ? #1017

Closed matdev closed 3 years ago

matdev commented 3 years ago

I've an app that uses to the android-beacon-library to detect when the smartphone enters in range of some Beacons. After opening the app for the first time and initializing the RegionBootstrap, I noticed that org.altbeacon.beacon.service.ScanJob are run by the lib. This seems to cause delays with the app's main Bluetooth scanner, which runs only when the app is in foreground.

Therefore, I'd like the Beacon lib to scan for beacons only when the app is in background, or closed.

What is the best way for implementing this behavior please ?

Android Beacon Library version

2.17.2

davidgyoung commented 3 years ago

See answer here: https://stackoverflow.com/a/65834242/1461050