Bluetooth connectivity issue: Mobile screen goes black when searching for BT devices

I've tested with another phone with a very old Android version and it works. Apparently, since Android 12 the apps need to ask for BLUETOOTH_CONNECTION permission first. I've found the solution here: https://www.youtube.com/watch?v=MNLzS-MOXAg , I have not tested it yet, though.

did you enable bluetooth?
Taifun

Yes.
It works in Android 12 adding the following blocks:

2 Likes

Hi Abdurrahman. Search for something like 'nearby device permissions' and grant it to your application. In Android 12, it may not be called exactly that. Try it.

my Samsung tablet android version : 13

same device, same codes, but one list shows up and one does not. i am not understand :frowning:



Taifun look it please,

same device, same codes, but one list shows up and one does not.

i think different a problem... not permission problem..


Hi Abdurrahman

The project that is working - is the code on Screen1?

Hi again Abdurrahman

Your BT Connect code should never be in Screen Initialize - why are you concerned about Scanning for available devices when you have a hard-coded address set to be connected?

..... and you are not handling the permissions properly, you must check that all permissions requested are granted before any Bluetooth function is called.

Screen1 is only splash image.

...and the other points I queried?

we need sometimes out of automatic connected address different bluetooth device scanning.

if i do permission control before bluetooth connection, user will must connection manually. i want connection automatic. what is your suggest (is it clock timer)

It can be in the Permission Granted Block.

... but that is not coded as "sometimes", it is hard-coded as "always".

I was having the same problem. The screen goes black when trying to find bluetooth devices. I'm using Android 12. I tried to allow MIT AI2 Companion access to detect nearby devices in the Android app settings and it worked.