Unexpected behaviour of Bluetooth

Hello All,

I'm new to APP Inventor and my questions are probably due to my poor experience.
Nevertheless, I was not able to find any suggestion in the forum for the following two issues:


  1. When the screen is started, clock 1 works fine and polls bluetooth status every 2s.
    Info on status is then displayed correctly.
    After I have connected the bluetooth client (microcontroller with BT interface),
    I receive data and the data is displayed, but when I
    disable bluetooth on the android device, the bluetooth status (ListPicker-Text) still displays "Bluetooth okay", i.e. connected.
    Why so?

  2. Same situation, client first connected, then bluetooth disabled.
    I would expect that the "global motodata list" is emptied. Instead the display is frozen
    and the last received data is still displayed.
    Looks like "Bluetooth client1, Is connected" is still true. (Obviously the same problem as above)
    Again, why?

Thanks for any help!

bR, wolfgang

The bluetooth classic component cannot check if the connection is still active. Once during the connection, the "is conected" block sets to true and it will remain so until you disconnect bluetooth in the application. There are tons of questions on this topic in the forum, so you looked poorly. There is only one answer. Use the clock and send any control byte to arduino. If arduino is disabled and the app wants to send data, then the app will return an error. Use the "error occured" block to disconnect BT after detecting an error and set the labels and colors appropriately.

Thanks for the quick and detailed answer. Looks like I used the wrong search phrases or did
not understand the reference to my problem. Might need to work on that...
Anyway, I now know, what to do :slight_smile: