How to connect to wifi using c++?

I want to create an app for android where you need to connect through a network when you buy a specific item, but cant find an answer through the net, so wondered if anyone could answer me. I am asking for a script that gets the ssid of a wifi network that youll choose then connect to that wifi, if the wifi has password, the app gets the password from the user and connects to the wifi itself without closing the app.
Hey, please an answer anyone?
any help here.
Topic archived. No new replies allowed.