admin管理员组文章数量:1391929
I am using the reference app () without any modifications except for the following:
// beaconManager.setEnableScheduledScanJobs(false);
beaconManager.setBackgroundBetweenScanPeriod(0);
beaconManager.setBackgroundScanPeriod(1100);
// Ranging callbacks will drop out if no beacons are detected
// Monitoring callbacks will be delayed by up to 25 minutes on region exit
beaconManager.setIntentScanningStrategyEnabled(true)
I am testing it with an iBeacon on a Redmi Note 8 Pro running Android 11.
If the reference app is open, it works fine. However, if it is moved to the background (without closing the app), the logcat simply stops printing any logs after about a minute.
As soon as I reopen the app, the log continues, and the iBeacon is detected again.
What could be happening?
I expect the scanning to continue when the app is in the background, but the app simply goes to sleep.
I am using the reference app (https://github/davidgyoung/android-beacon-library-reference-kotlin) without any modifications except for the following:
// beaconManager.setEnableScheduledScanJobs(false);
beaconManager.setBackgroundBetweenScanPeriod(0);
beaconManager.setBackgroundScanPeriod(1100);
// Ranging callbacks will drop out if no beacons are detected
// Monitoring callbacks will be delayed by up to 25 minutes on region exit
beaconManager.setIntentScanningStrategyEnabled(true)
I am testing it with an iBeacon on a Redmi Note 8 Pro running Android 11.
If the reference app is open, it works fine. However, if it is moved to the background (without closing the app), the logcat simply stops printing any logs after about a minute.
As soon as I reopen the app, the log continues, and the iBeacon is detected again.
What could be happening?
I expect the scanning to continue when the app is in the background, but the app simply goes to sleep.
Share Improve this question asked Mar 12 at 18:03 Jose BravoJose Bravo 11 Answer
Reset to default 0Xiaomi and Redmi branded phones are notorious for killing apps in th background whether they are doing Bluetooth beacon scanning or anything else.
While you are unlikely to get background beacon detection apps working well for general users with on these heavily non-standard Android phones, you maybe able to modify your phone's settings so you can use it for development.
Please try some of the configuration techniques here to see if any of them help. https://dontkillmyapp/xiaomi
本文标签: Android AltBeacon Library detecting Stoping on Background as IntentStack Overflow
版权声明:本文标题:Android AltBeacon Library detecting Stoping on Background as Intent - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744735483a2622301.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论