How do i scan for bluetooth devices?

Hi, what i am trying to do is scan for bluetooth devices and also check if the device has bluetooth and if its already connected to the watchdog.

But nothing seems to work, i also get error 908, dont know why. Also the list is not showing.
Is there any platform which explains the kodular?

it is not possible to enable Bluetooth programmatically anymore…

In Android API 33+ this method is deprecated. Enabling/disabling bluetooth without user consent is not more possible. You should use android.bluetooth.adapter.action.REQUEST_ENABLE instead.

When exactly do you get the error message? Can you provide the complete 908 error message? As far as I can see, the blocks look fine…

Alternatively you could use the Bluetooth extension App Inventor Extensions: Bluetooth | Pura Vida Apps which has been tested for sdk 34…

Taifun

It worked for Android Version 11 it think, but now i am on version 13. I have read that i have to use : android.permission.BLUETOOTH
android.permission.BLUETOOTH_SCAN

There is no Problem, but i have to activate bluetoote manuell, i want it to be automatic.

Aa already mentioned this is not possible anymore, read my previous answer
Taifun

Sorry,didn’t know you refering to this. So i just have to use open settings block and so on? Secondly; Error 908 READ_EXTERNAL… dissapeard but then came back and i dont know why.

My Code:

Your blocks do not really make sense

Usually you can’t use the activity starter to ask for permissions… use the AskForPermission method from the screen drawer

Are you aware about the consequences in using the MANAGE_EXTERNAL_STORAGE permission? See also

to find out, how to ask for that permission correctly

I showed you a screenshot how to do it…

And to ask for the 2 Bluetooth permissions, what about checking how others are doing it? For example Bluetooth liste of devices deosn't work anymore - #7 by Anke - MIT App Inventor Help - MIT App Inventor Community

Taifun

Why is it when i use the Bluetooth Admin Block,that the error 908 The Read_External_Storage Permisson has been denied shows up? I am asking for the permission but it doesnt work.

image

That permission only exists for Android 10 and below

Taifun