user3585140
user3585140

Reputation: 1

Enable WIFI and/or mobile data from Android app (C++Builder XE6)

I've been looking for a way to enable WIFI and/or mobile data from my Android-app (C++Builder XE6) but thus far I haven't found a way to do so. Browsed header-files, samples and internet but no luck so far. The whole Android part is pretty new to me, C++Builder is not.

Am I missing a component or sample here or should it be that easy it's listed nowhere? Any help would be appreciated.

Upvotes: 0

Views: 326

Answers (1)

Squonk
Squonk

Reputation: 48871

I don't know anything about C++Builder but I do know Android doesn't allow enabling wifi or mobile programatically - this must be done explicitly by the user.

You can do this in your code by checking to see if any network is enabled and, if not, taking them to the relevant settings page.

There is a subtle exception to my first statement though - if both wifi and mobile are enabled then the wifi connection will be the default used. If you want to switch to mobile it is possible to switch off (but not disable) the wifi network connection programmatically.

Upvotes: 0

Related Questions