I need to create a Robotium application that would use Settings application to turn ON/OFF WIFi from menu Settings->Wireless & networks->Wi-Fi. I managed to find some sa
The best way to enable wifi from your application would be to use the WifiManager.
WifiManager wManager = (WifiManager)getSystemService(Context.WIFI_SERVICE);
if(!wManager.isWifiEnabled() && wManager.getWifiState() != WifiManager.WIFI_STATE_ENABLING)
wManager.setWifiEnabled(true);
Note: You also have to add the following permissions to your manifest