For a long time my device would always auto start WIFI now it does not. Could someone show how to turn wifi on automatically when device boots? Also if my app sleeps sometimes on recovery wifi is gone? Show how to test if wifi is active and if not active how to turn it on programatically. Thanks
Asked
Active
Viewed 258 times
1 Answers
2
Use wifi manager class and use the following code to test wifi connectivity
WifiManager wifi = (WifiManager) getSystemService(Context.WIFI_SERVICE);
if(wifi.isWifiEnabled()) { // write your code }else{ wifi.setWifiEnabled(true); }

krupa parekh
- 500
- 3
- 7
-
Ok. Now my app really needs to be connected to WIFI as well as WIFI enabled for it to work. How do I program a delay until the WIFI is connected too during Powerup? Please respond to question below: – Androider May 02 '11 at 07:47
-
http://stackoverflow.com/questions/5854667/how-do-i-delay-startup-until-wifi-connects – Androider May 02 '11 at 07:48