I'm new to app inventor and I ran into a problem. I launch a first screen with an image. After pressing an OK button, the main screen is initialized.
And there, I am looking for a bluettooh device to connect and I put this search in the initialization procedure of the main screen.
Because of this, the main screen does not appear until the initialization procedure is completed, which takes 1 or 2 secondes where nothing happens.
As I see that the screen is not displayed, I would like to launch a bluetooth search procedure after the initialization procedure so that the screen is displayed.
How to do ?
(Maybe activated a clock in the initialization procedure which launches the bluetooth procedure but that seems strange to me as a solution)
Any help would be appreciated
Hi @Herve_Mo ,
you're definitely right. If you want to display a splash screen (with a picture, for example) you put in the screen initialization block a start timer command with a time delay of 1000 ms (example), After 1000 ms the clock fires, it shall then disable itself and start the BT connection. Once connected, the flow of the app can go on. Effectively when the BT connection block is trying to "pair" a BT client, nothing else can be done. Remember that AI2 is a single thread.
It's not so "strange" .
Hi @Herve_Mo,
most probably I'm older than you (I'm 64) As a general hint, please be prepared to use clocks many times when using AI2.The structure of an AI2 app is "event triggered" so if you want to have a time based execution you should organize your code as a scheduler (i.e. a timer tick that fires every x ms and then it executes tasks every m,n,o,p,q,.... multiples of the base tick). So, welcome on board
Cheers, Ugo.
thank you for your explanations grandpa (I am 56 years old )
I started with assembler on commodore 64, it has changed since
After playing with the arduino, I test the esp32 and I have just discovered app inventor, so the phone must drive the esp32
Going back to your question, yes, typically it's better to use virtual screens. I typically use Horizontal Arrangements or Vertical Arrangements to do that, by setting Visible yes or not.
There is also the possibility to make a "fade-in" and "fade-out" of these virtual screens by using the "Phase" extension from @shreyash (great job!!!):
Sorry I didn't see your message, I'll look into it thanks!
I transform my project to pass everything in virtual screen which will allow me to launch the bluetooth on the splash screen.
I had a little trouble finding the right version of the phase extension yesterday
Note that the disable block should be the first in the Clock Block. Also, first and foremost, you should ensure Bluetooth is enabled (switched on). If your Android version is > 9 and/or your Bluetooth version is BLE, Location usually has to be switched on too (that can be triggered by dragging a Location Sensor into the Project).
Note that the disable block should be the first in the Clock Block. Also, first and foremost, you should ensure Bluetooth is enabled (switched on). If your Android version is > 9 and/or your Bluetooth version is BLE, Location usually has to be switched on too (that can be triggered by dragging a Location Sensor into the Project).
Here the version before virtual screen . It's only graphic, I have also to send data by BT. Clock.aia (844.9 KB)
Ah ooooui !!
La Lancia Fulvia du 1967 c'est Ă un ami qui est lui qui fait les rallyes. Moi, lui ai fait le logiciel et l'HW c'est fait avec une ESP32 + un ARDUINO NANO.