I have created my first android app using the app inventor
.
It
involves connecting my phone to an arduino uno with a HC-05 module and
then switching some LEDS connected to the arduino on and off.
I have created two screens.
The first one has a pick list from which you select the appropriate bluetooth device from a list of available devices.
I
have created a control structure that attempts to connect to the
selected device and displays the message 'connected to ......' and then
switches to the next screen with some control buttons.
However the problem is that successful blue tooth connection in the first screen does not carry over to the second screen.
So how do you make a blue tooth client block element in the first screen available to the second screen in a connected state?
If
I attempt to do any serial communication on the blue tooth element in
my second screen I get a message saying that it is not connected to
anything.
I guess what I am trying to do is have a global (to all screens not just all elements in one screen) variable containing the Blue tooth connection.
FIRST SCREEN

SECOND SCREEN