BT paired devices empty list

Hello!
In November, I made an app that connects to a BT device. Recently, I wanted to make a small change and noticed that in the new application, the list of BT devices is empty.

As I browsed through the topics, I saw that there had been changes.
However, my poor knowledge of English and the APP Inventor environment do not make my task easier.

Can anyone give me a hint or show me how to change the blocks below so that I have paired BT devices available again?

"połącz" is "connect" button

(Canned Response ABG - Bluetooth non-BLE SCAN Permission Blocks)

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

You also will need to pull in TinyDB into your project.



When Permission Granted (@Patryk)

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.

(Thanks to @Patryk for correction to grant order)
Special note for Xiaomi devices:

Where I can find "AskForPermission"?
I don't see it in "Procedures" or in the "Bluetooth_Client1".

Ask for permission is a Screen 1 block.

These samples can be dragged in the browser, to save on retyping.

P.S. These blocks can be dragged directly into your Blocks Editor workspace.

See A way to group projects by theme - #10 by ABG
for a demo.

1 Like

Thank you for the advice. Unfortunately, drag&drop doesn't work for me. :confused:

OK. So I have these blocks

But when I run the app I get an error notification:

Bad arguments to >=
The operation >= cannot accept the arguments:, ["API Level not found"], [31]

What do you get back from Screen1.PlatformVersion?
Apparently, it might not be in the apiLevel list.

How I can check what I get?

Assign it into a Label.Text temporarily, or use the Companion's Do It facility.

Thanks for you time!

I found solution from @Anke in this topic below and it's work!

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