My app don't show the bluethooth list

I've put all the permissions, and i downloaded in two different movil phones and allow it to look for near devices and still no worked, but i've send it to a friend and it works in his movil.
Can someone help me?

Describe the phones and upload the .aia export

Samsung A13 and Motorola edge 30 are the phones in which the app don't work
ConsolaAitana.aia (32.5 KB)

I noticed something fishy in your blocks:

These blocks of yours are testing if the permission just granted is 'BLUETOOTH_CONNECT', and if so, they ask for that same permission all over again.

I don't see in your blocks anywhere asking for other permissions, like BLUETOOTH_SCAN.

Here's my latest canned response for Permissions:

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

The easiest solution, for immediate relief
(from @Barry_Meaker) ...

I had the same issue. The problem is your app does not have permission to see nearby devices. The solution is to give your app permission on your phone (no code changes in your app).

on your phone,

  • goto settings
  • search for your app
  • in App Info for your app select Permissions
  • change Nearby Devices from Not Allowed to Allowed
  • Done

By the way, the very first time you run the app, Android will ask if you want to grant the app this permission. If you say no, or ignore the pop-up, the permission will be set as Denied. Android will not ask again.

A more complex approach, for professional app development:

See Bluetooth liste of devices deosn't work anymore - #7 by Anke
Special note for Xiaomi devices:
I have an error with bluetooth on android 12, Xiaomi Poco X3 NFC - #20 by Patryk_F

...

P.S. These are all your blocks for the other Power Users, in case I missed something:

It still not working...
What I should do?

Show your corrected blocks

image

Instead of using text, use App inventor's permission labels:

Compare your blocks again to the working solution from here

Taifun

Deleted

Recommend you keep the App stable by checking the connection before sending data:

blocks

You can also use a Clock Timer to extend the time available for the scan of devices, after checking that Bluetooth is enabled on both devices. I always do this, and also use a timer for the initial connection too.

Also, how you exit a BT App is critical - make sure the Client is disconnected and any Clock timers disabled, otherwise they could still be running when you re-start the App!

So:

Snap3

1 Like

Hi Aitana

We have not seen you device Script (Sketch) so we do not know if the App drives your Robot. However, I have tested the attached and the Device List works. See if it works for you.

ConsolaAitana_2.aia (40.9 KB)

1 Like


Thanks you for the effort, but the bluethooth list still not working

Try this one:

and post screenshot(s) like this:

grafik grafik

Is it what you expected?

Yes