Sumit Joshi
Sumit Joshi

Reputation: 1

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

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.

Upvotes: 0

Views: 1029

Answers (2)

CommonsWare
CommonsWare

Reputation: 1006554

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.

Upvotes: 1

Prem Prakash
Prem Prakash

Reputation: 120

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

Upvotes: 0

Related Questions