Automatically connect to a specific WiFi SSID as soon as the app is launched

Hello!
With Taifun WiFi extension by @Taifun
I'm trying to make sure that when I launch the app my smartphone automatically connects to a specific SSID address (in this case the SSID is "LEDControl").
But that doesn't happen. Can anyone help me figure out how I could do this?

I would like that every time I launch the app it automatically connects to the "LEDControl" SSID both if it is not connected to any WiFi and if it is already connected to a WiFi other than "LEDControl"

Thanks in advance.

Looking at your blocks it llooks like you expect to happen everything immediately.. this is not the case... to enable wifi takes a few seconds, same to connect to a SSID...

However concerning the ConnectSSID method, let me copy some notes from the documentation, because it looks like you have overseen it...

Note : Android will get more and more restricted. The ConnectSSID method does not work anymore starting from Android 10. According to this Stackoverflow answer: For API30 we can use a new Intent action, for API 28 and below we can still use the old way of adding Networks, but for API29 we have some kind of gray area where I was not able to find a good solution yet. . Meanwhile App Inventor targets API31 and I could take a look into this issue again. If you are interested in sponsoring the update of this method, please contact me by email. Thank you.

Taifun

Thanks for the reply.
Actually I tried it on android 9 and it works.