[REQ] Disable mobile network when wifi connected - Android Q&A, Help & Troubleshooting

I am looking for an app that automatically switches off the cellular radio when wifi is connected and switches it back on when wifi loses connection. I'm not talking about the APN data connection which already does that, I'm talking about the regular cell phone connection.
According to my lack of results searching through the forums, Market, and Google, such an app does not exist yet. Currently the best app I've found to do anything remotely like this is the Airplane Mode Wi-Fi app, which is a manual switch and a slightly cumbersome one at that, not nearly good enough for how often I go in and out of wifi.
The reason I ask for this is because I use Google Voice with SIP and a prepaid plan. I want to use SIP as much as possible to save my prepaid minutes for when I really need them. When wifi and cell are both connected with Sipdroid running and I receive a call, they both ring at the same time. To be sure I don't accidentally use prepaid, I usually reject the call and call back over SIP, which is slightly annoying for both me and the caller.
Might someone be willing to create this app? Or better yet, does it already exist and I just wasn't doing the right searches?

You can turn the phone radio off with code but you need to use non-public apis and probably extra permissions. For anyone interested, have a look at RadioInfo.java (Phone Info when selecting an activity with AnyCut).

I'll add the option to the Airplane Mode Wi-fi Tool.
It was simple, I'm testing it right now, then I'll update it in the market as soon as it works properly.
UPDATE: Done, go download "Airplane Mode Wi-Fi Tool" (free) from the market if you'd like to stay updated from there, otherwise install it from the attachment here.
It only enables airplane mode if it successfully connects to a Wi-fi network, if it disconnects, connection gets dropped, or wi-fi gets disabled from the settings or widget, the phone goes back to regular radio mode.
Make sure to check the Preferences and enable/disable it according to your preferences. It's disabled as default.
Enjoy!

Perfect! Airplane Mode Wi-Fi Tool has become one of my top favorite apps with this feature. Thanks!

cant' find it on the market
sorry: I needed to search for the translated name

zorxd said:
is this app still available on market? Can't find it.
Click to expand...
Click to collapse
It is, Market link -- Airplane Mode Wi-fi Tool
Also, you might be interested in this one, Market link - AutoAP

I found the application on the market, however it doesn't behave as expected. I have to manually switch to airplane mode, and then enable wifi.
What I would like is a single switch to enable wifi AND disable the cellular radio.
And then a single switch to switch back to cell radio with wifi off.
I will try autoAP, thanks

How hard is it on the battery if I always leave wi-fi on even when not used?

autoap seems just fine, I just have to disable wifi to automatically enable cell radio
thanks
However I think, from a marketing point of view, you should consider a better name. Auto AP sounds like Automatic Access Point to me.

Yeah, works fine on tablets without internal 3G. This provides a battery saver.

Related

[ISSUE] How to prefer Wi-Fi to 3G

I have a HTC Fuze. The last few ROMS that i have been using (Energy, RRE, Tael), all the Apps always use the 3G internet to do their work even if a much faster Wifi is connected. Is there any way to make all apps(including things like email) globally prefer the Wifi when available? Also I dont want to have to keep changing settings to do this, It simply needs to be "If Wifi available use it, else use 3G"
Thanks in advance.
What i did was to go to start>settings>connections>advanced>select networks and change the default connection to the internet to "My work network", rather than my 3G network. This way, if theres any connection to the internet needed, my phone will use my wifi connection. The problem with this, however, is that when you dont have a wifi connection available, the phone will not connect to the internet unless you change the above setting back to your 3G network. If anyone knows a better way, please let us know
no i cant keep switching. thats too much trouble. there must be a better way.
redskilldough said:
What i did was to go to start>settings>connections>advanced>select networks and change the default connection to the internet to "My work network", rather than my 3G network. This way, if theres any connection to the internet needed, my phone will use my wifi connection. The problem with this, however, is that when you dont have a wifi connection available, the phone will not connect to the internet unless you change the above setting back to your 3G network...
Click to expand...
Click to collapse
Does it automatically connect to WiFi when a known network is within range even when the phone is in sleep? If yes, does it disconnect once not in use for a while?
k.electron said:
no i cant keep switching. thats too much trouble. there must be a better way.
Click to expand...
Click to collapse
As far as I know there is no way to do it automatically. You can use one or the other but they must be switched manually. All HTC phones have always worked this way. Maybe if the demand was high enough which apparently it is not a Chef could come up with an app that would do it. But for now you must do it manually.
rexian said:
Does it automatically connect to WiFi when a known network is within range even when the phone is in sleep? If yes, does it disconnect once not in use for a while?
Click to expand...
Click to collapse
no i leave wifi off normally to conserve battery.
Solarenemy68 said:
As far as I know there is no way to do it automatically. You can use one or the other but they must be switched manually. All HTC phones have always worked this way. Maybe if the demand was high enough which apparently it is not a Chef could come up with an app that would do it. But for now you must do it manually.
Click to expand...
Click to collapse
that is extremely failurous. not preferring the fastest internet connection is major fail. did not know that.
My phone does this automatically. It uses the WiFi whenever it's on. If the WiFi is off, it uses the data connection.
Maybe I'm understanding it wrong?
|Jason8| said:
My phone does this automatically. It uses the WiFi whenever it's on. If the WiFi is off, it uses the data connection.
Maybe I'm understanding it wrong?
Click to expand...
Click to collapse
what the heck? how? u must help me find out..
i think it does prefer wifi over 3g in WM 6.5...!!
to check it out here is wt i've done....turn data connection off...check that its on in the notification manager "when u click on the task bar"..then run any app that needs internet " opera, msn messenger, email...etc" while this app is online..
now there r two ways to check it
1-the notification manager & see if it turned to 3g data connection...if so u should find a timer running in ur service provider section, if not then its only using wifi
2-check the communication manager & see if it turned the data connection on, if its off then its using wifi...
thats how it is with my touch pro...i'm using energy rom nov. 08 build
Indeed it prefers wifi connections 2 data, but You have to :
1. Have Known wifi spots in range
2. Keep wifi connection on, while in stand by
Keep in mind that if a program starts to use the data connection it wont change to use the wifi one. So firstly connect and then open programs.
wakady said:
i think it does prefer wifi over 3g in WM 6.5...!!
to check it out here is wt i've done....turn data connection off...check that its on in the notification manager "when u click on the task bar"..then run any app that needs internet " opera, msn messenger, email...etc" while this app is online..
now there r two ways to check it
1-the notification manager & see if it turned to 3g data connection...if so u should find a timer running in ur service provider section, if not then its only using wifi
2-check the communication manager & see if it turned the data connection on, if its off then its using wifi...
thats how it is with my touch pro...i'm using energy rom nov. 08 build
Click to expand...
Click to collapse
firiel said:
Indeed it prefers wifi connections 2 data, but You have to :
1. Have Known wifi spots in range
2. Keep wifi connection on, while in stand by
Keep in mind that if a program starts to use the data connection it wont change to use the wifi one. So firstly connect and then open programs.
Click to expand...
Click to collapse
apparently its some sort of combo of this. i am using 6.5. any apps that have been using 3g continue with it. and i have to go to the comm screen and turn off data to force new apps to consume wifi. which isnt too bad, certainly not as bad as going to the network options. i would wish they made this a bit more seamless like with the desktop technology, i can switch from wired to wireless lan without even dropping a skype call.
firiel said:
Indeed it prefers wifi connections 2 data, but You have to :
1. Have Known wifi spots in range
2. Keep wifi connection on, while in stand by
Keep in mind that if a program starts to use the data connection it wont change to use the wifi one. So firstly connect and then open programs.
Click to expand...
Click to collapse
now i have discovered a new problem. even if i open the app after i have wifi turned on and data turned off, some apps just dont want to use the wifii.
Bing maps and google maps for example just tell me there is no internet.
this is really pissing me off, whats the point of having wifi on a phone if the apps wont use it. i dont really care about the google location service if the data is through the internet, but atleast turn on.
lame.

[Q] Connects to mobile network even when wifi is available

Hi all
Not a power user's dilemma I'm afraid but I hope someone can help me out...
What's bugging me is that my wife's LG-P500 incurs a small charge every day because, despite all the settings telling me it should NOT connect to the internet via the mobile network at any time, it somehow still connects - even when wifi is available like at home.
This wouldn't be a big deal normally but because she's on a pre-pay txt only plan her credit gets used up quickly.
My HTC Wildfire uses NO mobile connection at all when I have wifi available. Any ideas why this should be happening with our LG-P500?
Great forums by the way and I'm slightly embarrassed to be raising this probably noob topic here but I can't find an answer anywhere else...
Thanks in advance!
I haven't seen that problem on my P500, with the void echo ROM (the stock firmware didn't stay on the phone long enough for me to try that).
The option to disable it is in:
Settings -> Wireless and network settings -> Mobile networks -> Data enabled (should be unchecked)
Or in the drop-down menu of the notification bar.
I'm not sure about the stock ROM, but on void, an additional icon appears on the notification bar whenever the mobile network is active.
You could also try disabling the option:
Settings -> Accounts & sync settings -> Background data (should be unchecked)
Thanks. I already did all the obvious stuff you mention, having seen it work fine on my Wildfire... Any other ideas out there?
Might this be related to Location Services using Cell tower information ?
Could try turning that off anyway.
If you don't want to use the mobile network for internet access, than go to Settings > Wireless & network settings > Mobile networks > Uncheck Data enabled .
If the network allows you, you can also select Network mode > GSM only, this will also save you some battery. For example, I only use wifi to connect to Internet on my phone, and I also checked the option "Use only 2G networks" (also saves battery), I'm connecting to my operator only for phone calls
What is your Wi-Fi sleep policy settings? Try setting it to Never.
When the phone goes into sleep mode, wifi is turned off to save on battery. May be that's the reason mobile network is getting connected in sleep mode. If u enable wifi policy to never sleep that will drain the battery. You can disable the mobile network from th3 notification bar that should help.
Many thanks for the help guys!
Wifi sleep: good idea, I'll look at that!
Location services: good idea, I'll look at that!
Data enabled: unchecked already.
The problem still strikes me as odd because although I have ALL the same apps (and quite a few more...), I don't have this problem with my little HTC Wildfire...
Update: the only way I could find to resove the issue was to invent and use a nonsense APN...
Wifi sleep was already ticked as "never" by the way.
Thanks again everyone who gave advice.
Yeah, I've also had reason to use an APN named "fake" with a proxy named 'fake", although i use "Z" now to save typing, LOL.
This is one of many things i would do when changing SIMs. I have had one SIM and phone that always set a new APN and this ended up costing me a few bucks in data fees before I re-changed the APN info.
I would also disable the data services, make sure WiFi was on (to provide priority data access) AND enable airplane mode.
Anyway, your experience has inspired me to check more deeply about my data usage. I don't like the idea of my phone doing data without my knowledge while it's in standy.
I prefer to manually choose which connection I would like to use, so if I'm using my data plan such as when I'm out, I go to notification and enable data. I only get 200mb a month so its easier for me than to always keep networks on even when I'm not using them. It also saves on the battery as well.
EDIT: you can check your data usage using 3g watchdog app, find it in android market
It easy to solve. Just install APNdroid
https://market.android.com/details?id=com.google.code.apndroid
It also has a widget. Works very well.

Tutorial: Really enable/disable Wifi Calling to Save Your Battery

You may have noticed, especially if you've got the new Free Wifi Calling feature from T-Mobile, that WiFi Calling is a BATTERY HOG. Worse, it hogs battery even when disabled. You can verify it's Hogginess even when disabled by noting it will almost always be the top APP in history using SystemPanel. It's incredibly badly coded, and if you've got a Rom with Wifi Calling on it, and you've had bad battery life, now you know WHY.
But, really, with the new Free Wifi Calling feature, we shouldn't have to kill it entirely.
You can freeze it with Titanium Backup, but that's a hassle. Likewise using Bloater to uninstall/reinstall it all the time. Wouldn't it be nice just to have a desktop widget to do it for you? Or be able to hook it into your "Home Wifi" profile, so it's always enabled at home, and then have it turned off as soon as you're no longer near your home wifi?
Thanks to user AntonX in this thread , I came across a method to simply kill the app at the system level until needed. Still not convenient. So, I whipped up some Tasker scripts which will help the situation.
This assumes you have Tasker, as well as a basic knowledge of how to use it. Here are your the TASKS to create (Don't create any profiles unless you want to)
You also need to have the Locale Execute plugin, which is free.
NOTE: For this to work correctly, leave the slider set to ENABLE in the wifi calling app, and disable the feature using the Tasker widget and not inside the app!
Create a Task "Disable Wifi Calling"
1. Variable Set %WIFIWASON to YES If %WIFI ~ on
2. Wifi Set Off
3. Wait 5 Seconds If %WIFIWASON ~ YES
4. Execute @!pm disable com.android.kineto
5. Wifi Set On If %WIFIWASON ~YES
6. Variable Clear %WIFIWASON
7. Variable Clear %WIFICALLING
Create a Task: "Enable Wifi Calling"
1. WiFi Set On
2. Plugin:Execute @!pm enable com.android.kineto
3. Wait 5 Seconds
4. Load App Wifi Calling
5. Variable Set %WIFICALLING to YES
Create a Task "Toggle Wifi Calling"
1. Perform Task Disable WIFI Calling If %WIFICALLING ~ YES
2. Perform Task Enable WIFI Calling If %WIFICALLING |~ YES
TO USE:
Add a Tasker Widget to your homescreen for the "Toggle Wifi Calling" task.
What is going on:
Disable script will check if wifi is on at the time it is executed. It has to turn Wifi OFF so we get a clean disconnect from the network and the taskbar Icon goes away before killing the Wifi Calling app. If Wifi was on beforehand, it turns it back on.
Enable script will make sure wifi is enabled, and give it time to connect, and then load the application since sometimes it won't activate on its own without loading manually.
These tasks are intended to be linked to Tasker widgets on your homescreen, but you can call them from location based profiles or whatever.
Now, when Wifi Calling is OFF, it is REALLY off, and not just sitting around, unused, sucking up your battery. With a little more work, this could probably be turned into a single "Toggle" task, but that's an exercise for someone who has slept and doesn't have work in 5 hours. Comments/Improvements welcome.
Update 1:
Added instructions for creating a Toggle widget at the same time.
Streamlined Tasks.
Planned Features:
1. Automatically disable WIFI calling app once WIFI has been disconnected to save battery. Seems to need a block to prevent the state from triggering during processing of the disable/enable tasks, as it breaks functionality. I'm sure it is trivial but I have a limited attention span.
2. Automatically enable WIFI calling app if currently connected to WIFI *and* cell has no signal for longer than a set time. (%CELLSIG)
3. [not possible?] - Audible warning that WIFI signal is getting low and you are currently on a call. Is there any way to read current WIFI signal strength with Tasker?
Very good guide and a great idea.. if only we could get a better coded wifi calling app... or one for cm7
Sent from a cell tower to the XDA server to you.
I love the idea, but I can't quite seem to get it working. When I run the "disable" task, it eventually turns WiFi back on and WiFi calling gets re-enabled.
Then, a while later I get an "app not responding" warning from the Android system for the execute locale plugin (I can select Force Close or Wait).
Also, what is the best way to grant SU permissions to the plugin in the SU application? I have never been prompted to allow it. To test it out, I just temporarily granted access to everything...
Thanks!
lotherius,
I follow on the G2X forums. And you know how the G2x & MIUI Roms can't seem to get Wifi Calling to work consistently. I noticed that if I can get the Wifi Calling app to stay turned OFF it allowed my Sim card to not get the "Invalid Sim" error and then I was able to get wifi calling to work again even after reboots. Do you think by any chance that this script could help cure our Wifi Calling issue with MIUI Roms??? And is there a way to make a flashable zip of this for us Noobs? Thanks Again.
GFam4 said:
lotherius,
I follow on the G2X forums. And you know how the G2x & MIUI Roms can't seem to get Wifi Calling to work consistently. I noticed that if I can get the Wifi Calling app to stay turned OFF it allowed my Sim card to not get the "Invalid Sim" error and then I was able to get wifi calling to work again even after reboots. Do you think by any chance that this script could help cure our Wifi Calling issue with MIUI Roms??? And is there a way to make a flashable zip of this for us Noobs? Thanks Again.
Click to expand...
Click to collapse
Nope, this script wouldn't help with that. The problem on MIUI roms on the G2X is due to the operator (T-Mobile for most) not sending the phone # directly to the SIM card when it is activated. Some SIM cards have it, typically older ones, so it works. Those without, however, find that it doesn't work.
Supposedly you can manually program the SIM by using a phone that supports doing so, but I haven't checked to see if that would fix the problem.
Also I no longer bother with this on the G2X as it appears that while wifi calling still uses *some* battery when not active, it's not the battery hog it was back on the Vibrant.
Lotherius,
I had an HD2 running MIUI with Wifi Calling working before the G2X. The is the hack/mod that this guy TyTung did to get wifi calling to work for the HD2. http://forum.xda-developers.com/showthread.php?t=1038784 You think something like this can be used for the G2X to get wifi calling working?
GFam4 said:
Lotherius,
I had an HD2 running MIUI with Wifi Calling working before the G2X. The is the hack/mod that this guy TyTung did to get wifi calling to work for the HD2. http://forum.xda-developers.com/showthread.php?t=1038784 You think something like this can be used for the G2X to get wifi calling working?
Click to expand...
Click to collapse
WiFi Calling is really picky about the network information being accurate. I'm surprised that they got it working on the HD2...
The best fix for it on MIUI on the G2X would depend on fixing MIUI itself, since the RIL is correct -- the G2X doesn't allow you to change the RIL so it isn't affected. In the case of MIUI, older SIM cards typically work better than new ones.
The issue comes down to the ability to read the network information from the SIM card. If that data has been programmed to your SIM card, then it might work. If it has not been programmed to your SIM card, then it won't work.
So basically... not saying it's impossible to get it working on G2X/MIUI, but it is more likely to require a fix to MIUI rather than to Wifi Calling.
lotherius said:
WiFi Calling is really picky about the network information being accurate. I'm surprised that they got it working on the HD2...
The best fix for it on MIUI on the G2X would depend on fixing MIUI itself, since the RIL is correct -- the G2X doesn't allow you to change the RIL so it isn't affected. In the case of MIUI, older SIM cards typically work better than new ones.
The issue comes down to the ability to read the network information from the SIM card. If that data has been programmed to your SIM card, then it might work. If it has not been programmed to your SIM card, then it won't work.
So basically... not saying it's impossible to get it working on G2X/MIUI, but it is more likely to require a fix to MIUI rather than to Wifi Calling.
Click to expand...
Click to collapse
I wish i knew what Lib's and RIL's that I can swap from a CM7 Rom (Weapon G2X, Eaglesblood, or TSUGI) and push it via Root Explorer. I did this on my Hd2 and had wifi calling working. Can't this method work to get wifi calling working on G2X. Sorry I know this is off topic. But I even had Wifi Calling on your TSUGI ROM. You wouldn't happen to know what Lib's & Ril's on your TSUGI Rom are responsible for Wifi Calling to be enabled?
Is battery life really bad with wifi calling for you guys? I use it nearly 24/7 on my phone, and get fantastic battery life. Like way better than I did without it.
Of course, I'm on the clearly superior HTC G2, but still
I've been toying with this, but anytime I force Wifi calling to disable (by killing the app or disabling kineto), restarting Wifi calling says I'm not registered with the T-Mobile network (sure) and won't connect (even after clicking Register) until I reboot the phone.
Any tips?

[Q] How to set up this WiFi arrangement?

At work, there are two main networks - one that I can log into automatically (let's call it WiFi-Hospital) and one that requires authentication through a browser (let's call it WiFi-University).
When WiFi-Hospital is available (and strong), I'd like to use that one. When WiFi-University is available, I'd like to NOT connect to it automatically. What inevitably happens is that it will connect and then *think* it has WiFi, and if I don't notice, I won't get any email/GVoice, etc.
Can I do this with Tasker? Some easier / better way?
Thanks.
i don't know if this will work, but maybe in wifi settings, forget university network, connect to it again, and there maybe an option to 'not connect automatically'?

Can't access any google services while using mobile data

hey all. in need of some assistance
i have an h830 running on cricket
i cannot access any google services while connected to mobile data (gmail, play store, drive/docs, etc). works fine over wifi
all other connections (web browsing, ssh, remote desktop) work fine, it's just google services
i don't think this has anything to do with cricket, as i don't have this problem on any other phone if i swap the sim card out
i'm running this deodexed nougat 20f build https://forum.xda-developers.com/tmobile-lg-g5/development/jan-17-2017-20c-deodexed-kernels-t3539611
though, i do have a 20a stock rooted nandroid backup which has the same problem
i have tried:
restarting, toggling data on/off
force stopping and clearing cache/data of all google services/apps/download manager/"media" app, restarting
wiping cache/dalvik
trying with battery saver on and off
making sure google play services and "media" service both have the following CHECKED/on: "background data" and "unrestricted data usage"
making sure "limit mobile data" is NOT checked
edit: and everything in this thread https://forum.xda-developers.com/oneplus-3/help/play-store-downloading-nougat-update-t3530277
to top it all off, i even tried setting up an openVPN server and a shadowsocks server (similar to VPN, traffic tunneled through encrypted socks5 connection). again, while connected to either VPN/shadowsocks through wifi, google services work. when on mobile data, it doesn't work (in both cases i confirmed i am still connected to the VPN as far as the outside world is concerned)
since it doesn't work even over VPN, i feel like it must have to do with some mobile data restriction setting somewhere
anyways, i'm baffled. unusable for me as a daily device without gmail/google services working over mobile data
so maybe this could help someone diagnose the issue:
it is resolved, temporarily, if i toggle to 4g/HSPA+ only mode (settings -> mobile data -> mobile networks -> "GSM/WCDMA"). it is still fixed if i toggle back to LTE
i'm not quite sure what causes it to "break" again. maybe when i connect back to wifi, or change cell towers, i dunno. but it always breaks again (all internet things work except anything related to google services) and i have to perform the toggle again
just to be clear, toggling airplane mode does NOT work. i specifically have to go to 4g/HSPA+ mode, then google services start working, and they keep working if i toggle back to GSM/WCDMA/LTEauto mode - until it stops working again for whatever reason
so... any ideas for a resolution?
if not, anyone know a way i can easily add the ability to toggle modes as a shortcut? thanks
edit: used quickShortcutMaker to at least add a shortcut to that screen, but if anyone knows a scripting tool or something i can use to directly toggle and cut out that step, much appreciated
I have exactly the same problem. Can someone revisit this issue and offer some ideas? Thanks.
same exact thing on the h830 i bought for a friend. she's on cricket and lte refused to work with google play (wi-fi is fine). did the toggle to hspa and everything worked, so i switched it to lte and it's still working.
i don't want to root it and delete the hosts file from the system, but that's what i think the real fix is.

Categories

Resources