Service to keep checking WIFI to turn ON all the time on android using service -
I write a service with WifiManager class to find out if Wifi is turned off or not If my code stops, the current service is turned on, now I have used a utility which manually turns off WiFi when the service is already running. I want to see the service whether Wi-Fi is turned on or not. If this does not turn on, my code is as follows. public int onStartCommand (intended intent, int-flags, int startId) {mainWifi = (WifiManager) getSystemService (reference.wifi_SERVICE); // Check for wifi is disabled if (mainWifi.isWifiEnabled () == incorrect) {// if wifi is disabled, enable it mainWifi.setWifiEnabled (true); } Wi = mainWifi.getConnectionInfo (); Toast. Make Text (this, "Network" + wi.getSSID (), Toast. LNNHHLLG). Show (); Return START_STICKY; } Can anyone tell me how to do this work What I am now seeing is that which I have ever put in on the internet commencement, only once the service started But I want to run it all the time at all times and want to do some operat...