Android Question Switching Wifi Network


Licensed User
I have an app which is quite clever where it knows when a particular Wifi network is available and upon detection of its presence, the app will then force the current home network off the tablet and allows the new Wifi network to become the current active network.

Then the app starts to communicate via the new Wifi connection. In this instance it is an app that enables file transfer from a Wifi camera.

When the new Wifi connection becomes unavailable (ie camera switched off), the app will reinstate the home Wifi network.

I would like to know how the app achieves that clever feat. And is there a lib or example in b4a that can accomplish those steps?

Thank you.