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.
精彩评论