Empty Bluetooth paired device list when using Bluetoothclient.AddressandNames

I have an app which uses Bluetoothclient.AddressandNames in a listpicker's beforepicking event to display the list of paired bluetooth devices. The app was working earlier and showing the paired devices but today when I recompiled the app on ai2.appinventor instance, the devices are not shown anymore. When I compiled the same app on code.appinventor instance , the devices are displayed correctly.
I observed that the builds on both these instances are from different dates.

(Canned Response)
These blocks can be dragged into your Blocks Editor to request permission(s) for Bluetooth scanning and connecting. All three parts are needed.

Thanks to @Anke for the original code.
My changes include

  • use of the Screen1 permission blocks to avoid the possibility of a typo
  • using a TinyDB tag particular to BT permissions and only for BT permissions.

by @ABG

Thanks Taifun. I was asking for BLUETOOTH_CONNECT permission. I will try these blocks and let you know.
Only thing I am not getting is what are the numbers after n2.1,... in the textbox in apiLevel procedure.


The API level conversion turns internal operating system level into a number usable in a math comparison block.

1 Like

Thanks a lot Anke.
I have one more question. Can you please let me know what is the difference between comparing with api level and platform version number?
Instead of api level, If I compare as platform version number >= 12, that also works. Hence the question.

We want / need a general solution and not only one that only works in this specific case. So either you use an extension (GetAPI) or do it the way I suggested.

And remember to update this list in your apps when new android is released, otherwise it won't work on new android which is not in the list.

Thanks everyone for your help. The issue is resolved now.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.