Location needs to be enabled for Bluetooth Low Energy Scanning on Android 6.0

前端 未结 8 645
旧巷少年郎
旧巷少年郎 2020-11-27 13:05

After upgrading to Android version 6.0 Bluetooth Low Energy (BLE) scanning will only work if Location services are enabled on the device. See here for reference: Bluetooth L

相关标签:
8条回答
  • 2020-11-27 13:51

    You can scan BLE devices without location access using CompanionDeviceManager (API26). https://developer.android.com/reference/android/companion/CompanionDeviceManager.

    0 讨论(0)
  • 2020-11-27 14:00

    Well, I have looked at my code written in Eclipse and I use there the startScan (API 21) function without declaring location stuff in manifest file. I still get the proper callback. Have you tried running the code without the location declaration? In the other hand - you can use the deprecated startLeScan (API 18) which does not require these permissions. However, in my opinion searching and reading desired characteristic in service is more complicated with API 18 methods.

    0 讨论(0)
提交回复
热议问题