Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is changed with Bluetooth in Android SDK 32?

After changing my targetSdk to 32, I get the following error:

Settings key: <bluetooth_address> is only readable to apps with targetSdkVersion lower than or equal to: 31

I think this is happening while checking permissions while loading my app.

like image 869
Sean Avatar asked Oct 20 '25 17:10

Sean


1 Answers

Issue is due to few parameters are annotated with maxTargetSdk = Build.VERSION_CODES.S enter image description here

For bluetooth_name I found the alternative and reading device_name using below code:

Settings.Global.getString(application.contentResolver, Settings.Global.DEVICE_NAME)
        ?: "UNKNOWN"
like image 117
N V D Munesh Adabala Avatar answered Oct 23 '25 06:10

N V D Munesh Adabala



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!