Bluetooth scanner android 12 error

Hi everyone, these days I was trying to develop an android app that scans and searches for nearby bluetooth devices... I noticed the application works great on android 10, but on android 12 devices it gives me the following mistake:

Please help me, it's very important...
PS: sorry for my english and thank you all

Hello LuckyLea, welcome to the forum.

If you search the forum you will easily find the answer: Android 12 devices have strict Goggle security measures and the developer (you) must ensure the App User (your customer) permits access to Bluetooth and various Bluetooth operations. Note that Classic Bluetooth and BLE (Bluetooth Low Energy) are very different. Your Android 12 device will no doubt be using BLE.

See:

Thanks for the immediate response... So you're telling me that in order for the app to work I should scan with BLE? In case i want to make the app usable for both android How should i do?

Neither the BluetoothClient nor the BLE extension will attempt to start an intent with the REQUEST_DISCOVERABLE action. Either you are launching this intent directly (via the ActivityStarter) or you are using an extension that does so. In the case of the latter, it would be better for the extension author to update their code to ask for the appropriate permissions first before launching the intent. If you're using the ActivityStarter, than you will have to request the permission in the blocks first before starting the activity.

However, the source code of the extension is available on GitHub, if needed I could modify it... If so, could you help me? I leave below the link for GitHub: GitHub - vknow360/BT: Extension to work with Bluetooth (For MIT AI2 and its distros)

My classic bluetooth extension is up-to-date...

Taifun

1 Like

I have the java source code of the extension I used, could you explain how I can compile it? Actually I noticed that the authorization that android 12 requires is not present in the code maybe this way I can solve it... Please help me as soon as possible. I am grateful