We all know that Android takes care of this task internally. However, it not really turns off the mobile data completely. The result of that is there is always some battery draining behind the scenes. Keeping mobile data or Wi-Fi ON unnecessarily drains your phone’s battery at quite good rate.
So is there any workaround to automate this task? Well, there is but not as simple as you might have thought. To turn off the mobile data automatically, some app will have to dig into the system. You will first need a rooted Android phone to make this happen.
Automation of various tasks is the need of the hour because there are so many functions to deal with in an Android phone. Similarly turning off the mobile data when on Wi-Fi is one such task which needs to be automated. So here is a step by step guide to that.
Turn off mobile data automatically when on Wi-Fi
Step 1: Install Tasker app from here.
Step 2: Grant the root permission to Tasker app.
Step 3: Open Tasks and create a new shell command task by choosing “Run Shell” as an action. Give it a name as “Set Off” or something that you prefer.
Write command as “svc data disable” and don’t forget to use root.
Step 4: Similarly create a new shell command task and give it a name “Set On”.
Write command as “svc data enable” and use root too.
Step 5: Go to Profiles and create “Wifi Connected *,*,* ” profile.
Step 6: Assign above “Set Off” as an entry task and “Set On” as an exit task. Now keep the profile active.
Now whenever your phone connects to Wi-Fi network, the mobile data will get turned off automatically.
You can also restrict this to any specific Wi-Fi network too. The Wifi connected profile provides you the optional options such as SSID, MAC and IP.
Every Wi-Fi enabled router has all these options. Just mention any of the three fields and you are good to go.
Although Tasker has inbuilt task to turn off mobile data, it may not work on all devices. Especially for the devices running on OS 5.0 and plus. i.e. Lollipop and further.
There is another app called “secure settings plugin” which could toggle mobile data. However, the app is no longer updated by the developer. It fails to match the latest OS updates.
So you will have to run shell commands in order to get this done. Tasker has an ability to automate various tasks that you would always imagine an Android phone could do.
Thus, you can turn off mobile data automatically when connected to any Wi-Fi. It eases your task of going to the notification panel and turning it off whenever not required. If you have any alternate method or any comments then share them below.
Update: You can also use Droid Automation to turn off mobile data automatically when on Wi-Fi. Since Tasker is a paid app, you can use this app for a free solution. You will have to create two profiles using the inbuilt triggers.
This app also requires root access and it does exactly same thing as above. However, it is not as effective as the former one. Sometimes you will have to manually run the profiles.