Home > Net >  How to scan BLE devices in Android without giving location permission?
How to scan BLE devices in Android without giving location permission?

Time:06-15

Description: I am scanning the nearby BLE devices in my android application and allowing users for these permissions ACCESS_COARSE_LOCATION and ACCESS_FINE_LOCATION which requires enabling location in the Android device.

What I am looking for: I need to remove the location permission from the app to scan nearby devices.

CodePudding user response:

I believe it is not possible to do what you are trying to achieve. for more information check the android developer documentation.

https://developer.android.com/guide/topics/connectivity/bluetooth/ble-overview

CodePudding user response:

On Android 12 and higher, you should be able to use BLUETOOTH_SCAN as the permission.

On older devices, you have no choice but to request ACCESS_FINE_LOCATION. You do not need ACCESS_COARSE_LOCATION.

  • Related