Itoo + Bluetooth + (true) multiple Screens

Dear all,
the capabilities if Itoo (great @Kumaraswamy !!!) are one more than infinite !
For those who want to make their life difficult, by using multiple screens, and want to have a unique BT communication from the screens, Itoo comes to help.
The annexed .aia is a very raw example on how to use Itoo to handle a unique BTclient acrross Screen1 and Screen2 (if you want more screens, I believe you can elaborate my example on your own).
Provided that by using "virtual screens" can be much more easy and efficient, but since very often a request about the possibility to have more screens exchanging data to a single BT server arises, I've tried to find a solution.
As of today the answer has been always that when changing from one screen to another the BT communication ceases.
But, by using Itoo that runs in background, I've found possible to maintain alive a unique BT client across screens.
Practically Screen1 initializes Itoo, allocates on Itoo the BT client and exchanges data via BT.
Then Screen2 applies to Itoo and uses the same ciient to send and receive its own data on the same BT client.
Obviously to exchange data across screens one shall use the TynyDB, but this is another story. Here, I bound my example to the BT.
The second annexed file is the Arduino (UNO + HC06) code that is the counterpart of the APP.
The main structure is: once started Itoo from Screen1, by pressing a button , the character "A" is sent to Ardiuno (from screen1), Arduino receives it and sends back "RA". The same applies after having switched to Screen2: by pressing a local button the character "B" is sent to Ardiuno which sends back "RB".
During the screens switching the BT client remains alive.
BT_itoo_Two_Screens.aia (167.0 KB)
BT_Send_Monitor.ino (2.0 KB)

CREDITS:
@Taifun for his extension TaifunTools to keep awake the screen
@Kumaraswamy for his extension ITOO

Blocks on Screen1

Blocks on Screen2

In a nutshell: Itoo manages a unique BT client that can be accessed (by using Itoo rules) from several Screens.
image

1 Like

Thank you for the example

As we can see a lot is required to achive this, so the recommendation still should be: use virtual screens...

Also usually to have something running in the background in foreground mode requires a persistent notification to be shown to the user, which then can be dismissed... as you did not ask for post notification permission, that notification currently is hidden

Taifun

Dear @Taifun ,
I absolutely agree (and I said that in my first post): the easiest way remains the use virtual screens. :+1:
For me it has been simply a challenge and fun to see what Itoo could do across two screens and, since it worked, I'm happy that my brain isn't so rusty :rofl: :rofl: :rofl:.

Gute Nacht !

1 Like

Dear @Taifun, please apologise me, I've noticed right now that I forgot to mention your extension in my app :upside_down_face: :upside_down_face: :upside_down_face: This means that a bit of rust is laying in my brain.... :rofl: