I am trying to connect to BLE device in Android 12 using connectGatt
method but It's not connecting.
Below Android 11 it is working fine.
Manifest.permission.BLUETOOTH_SCAN
and Manifest.permission.BLUETOOTH_CONNECT
.The required device MAC address is found in discover callback. But, When I try to connect It's not receiving any callback and after few seconds It's sending me DISCONNECT BroadcastReceiver.
Many beacon devices still require location service for scanning.
That's why location service still requires in Android 12, giving permission to location android.permission.ACCESS_FINE_LOCATION
and android.permission.ACCESS_COARSE_LOCATION
also allows android.permission.BLUETOOTH_SCAN
in AndroidManifest, and explicitly grant these permissions at runtime.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.