开发者

Turn Internet connection on

开发者 https://www.devze.com 2023-03-12 22:58 出处:网络
It is possible to active WiFi or mobile internet at the backend from one application? I create an application which needs Internet access. The app should check the Internet connection when i开发者_JS百

It is possible to active WiFi or mobile internet at the backend from one application? I create an application which needs Internet access. The app should check the Internet connection when i开发者_JS百科t starts. If there is no connection, then turn WiFi or mobile Internet connection on.

Is this possible?

I use the ConnectiveManager to check connectivity state.


You can use setWifiEnabled() to change the wifi state.

If there are no wifi networks configured, it should automatically use the data network if any. Use the ConnectivityManager to check if there are any data networks.

0

精彩评论

暂无评论...
验证码 换一张
取 消