【问题标题】:Scanning for BLE devices on Android 8+ in the background在后台扫描 Android 8+ 上的 BLE 设备
【发布时间】:2018-10-12 10:52:19
【问题描述】:

我在 Android 8+ 上使用 BLE 扫描仪 API 中的以下方法 扫描BLE信标

startScan(List<ScanFilter> filters, ScanSettings settings, 
PendingIntent callbackIntent)

问题是,有时我可以看到扫描日志,但callbackIntent 没有提供任何内容,知道为什么会这样吗?

【问题讨论】:

标签: android bluetooth bluetooth-lowenergy android-ble bluetooth-gatt


【解决方案1】:

这是 Android 8+ 上的预期行为。如果您需要连续扫描,则在这种情况下需要周期性机制。有关在不同 Android 版本和不同方式上扫描的更多信息。看看here

【讨论】:

  • 好吧,如果您有前台服务,那么您链接的限制将不再适用。
  • 正如我所说的,它用于后台扫描。并非所有用例都需要前台服务,这就是我们的情况。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2020-11-25
  • 1970-01-01
  • 2013-08-18
  • 1970-01-01
相关资源
最近更新 更多