I perform all my communication via the internet (Jabber, SIP), so I only need cellular as a backup.
Additionally, coverage at my home is near to nonexistent and as a result, battery drains in a few hours (as opposed to few days when GSM is disabled).
Is there an app for disabling cellular communication entirely (airplane mode) if a WiFi network is present, and enabling it otherwise?
I'm not interested in solutions which disable just the data connection: Android handles that already.
I'm OK with solutions which require rooting, rebuilding Android, etc.
Answer
Might help to look into @Izzy's solution involving tasker.
A tweak is needed:
- Instead of detecting a GSM/CDMA signal, check if a Wifi network is present nearby
- Switch to/enable airplane mode and enable Wifi and connect appropriately (this part am uncertain about - if its an open public Wifi point, good (its bad but another story about open Wifi's) What if it's a private Wifi network and need to input the key? Tasker might be able to help you with that, unsure!
- If moving away from network point, switch off/disable Wifi and disable the Airplane mode.
Having a look here at this wiki titled "Turn on Wifi at home" entry might also help you as well, to quote, in case of link rot:
My route to and from work is populated by open networks from cable providers that require log-in via webpages and unsecured home networks. Whenever I pass them my phone tries to connect, disconnecting me from 3G. Leaving WiFi on all the time means I'm left with constant service interruptions. forgetting to turn on WiFi at at home runs the risk of eating up my data plan. For this reason I turn off WiFi when I'm out and turn it on when I get home. But what if I forget?
With this Tasker profile, my phone now uses cell location data to turn wifi on/off.
Steps:
Turn GPS on (just for now). You don't need to keep it running all the time, but it helps to pinpoint where your location for the context step.
First, go home (the place your wifi router lives).
Profile: WiFi At Home Context: Location > Net=On, GPS=Off, Radius 500m, Get Fix
Task: At Home Action: Net > WiFi > On Task (optional): Alert > Popup > Text "WiFi On"
Task: Leaving Home Action: Net > WiFi > Off Task (optional): Alert > Popup > Text "WiFi Off"
Get Fix locates where you currently are on a map so you need to actually be at home for this step.
You have several setting options depending on how much power consumption vs. accuracy. See [html http://tasker.dinglisch.net/userguide/en/loctears.html "Location Without Tears"]. The least accurate (Net=Off, GPS=Off) needs a really large radius. The most accurate (Net=On, GPS=On) will drain your battery faster.
I find Net=On, GPS=Off, Radius 500m to work fine. My phone knows when I'm home.
No comments:
Post a Comment