A non-suck Tasker data management script - AT&T Samsung Galaxy S II Skyrocket SGH-I727

Suggestions or questions are welcome!
Description:
Here is a simple-ish script I wrote to manage data flow on my phone. Mobile data on/off is easy enough but what most users have a hard time pulling off is when to toggle wifi on and off with minimal consumption. Using local tower states is pretty common but it's inaccurate and slow; additionally my method uses less battery life.
Room for improvement:
The only thing I would like to do in order to improve this is to have the script not disable data when downloading or streaming. This is possible but is unique per device per ROM so I can't really go into detail about how to do it. As a summary though there's a file that is written to that keeps information about bytes traffic. You just read this file to determine how much data is flowing in a specific interval and if it exceeds a certain amount then don't turn off data just yet. It's also a known issue where with some devices the 3G state change won't register when toggling manually while connected to wifi.
Features:
Wifi and 3G will disable two minutes after the screen is off so it's not constantly toggled through intermittent use.
On some phones or providers the 3G status becomes unknown when in a call or when connected to wifi; this script works around that.
Unlike most data management apps this one will remember your 3G status should you manually change it, in case you don't want 3G on at all.
Data is still checked on an hourly basis(this can be adjusted of course).
Fast and accurate wifi connecting with very minimal power drain.
Just a few things explained for those curious:
I check the phone state to ensure that 3G isn't detected as manually disabled when your provider uses 3G to place calls.
I check the screen on time because on some phones/ROMs the 3G doesn't actually register as toggled until the screen flickers back on. Because of this 3G appears to only become disabled once the screen turns back on and it can be registered as manually turning it off.
The wifi timer exist so the script won't check for a wifi too frequently.
You can adjust the hourly checks under Cycle 3G.

What version of Tasker is this developed under? Just curious, I'm running the 4.0 beta, and I just had to back out of b19 to b18 because of issues with my data management profile. I'll try yours out, it sounds a lot better than mine...

Can't seem to get this to work...tasker wont recognize the file
Sent from my SAMSUNG-SGH-I727 using Tapatalk 2

It's working great for me on 4.0b18. I still need to look at the logic being used as to what causes it to 'wake up' and connect to wireless, is it simply a delay after screen on, or are you also looking at other factors?

Tasker 1.3.3u2
My friend had problems getting his to recognize the profile as well. I'm not sure why.. It might have to be in the proper directory. You might also have to make a new profile tab for it. Hopefully rpr69 can give us some insight.
But to answer your question as to how I check Wifi...
When screen turns on I immediately try to connect to Wifi before trying 3g. 3g will still enable briefly after for phones that require it for MMS. If Wifi isn't connected after X seconds then it disables Wifi and won't try again for 10 minutes. If it does connect successfully there will be no 10 minute wait next screen on.
Added manual toggle memory to Wifi as well. I'll post the changes later and update the zip file.

Are you importing the profile, or just dropping it in a directory? The proper way is to import into a new project. In 1.3 of Tasker (from memory, it's been awhile), you need to pull down from the top of the Tasker top bar which should then give you the Projects tabs. Long press on the Home tab, and you should get an 'import' option, navigate to where you downloaded the project file on your phone and select it, and it should create a new tab for it, with the profile and tasks under it. If you had previously just manually copied the xml file into the projects directory, move it out of there or the import may fail.
Looking forward to the update!

Ok got it to work I forgot is was a project and kept trying to import only a profile. It seems great so far!!!
Sent from my SAMSUNG-SGH-I727 using Tapatalk 2

To make it so it won't check wifi when you don't want it to add the following...
ProfileName - Record Wifi State
Trigger - State > Wifi Connected *
Enter Task - Set Variable %wifistate to 1 if screen ~ on
Exit Task - STOP If %ScreenOnTime + 2 > %UPS
......Set Variable %wifistate to 0 if screen ~ on
then under task "Data Types On - Type 2 P2"
very first line add - If Then > %wifistate = 1
Place a closing End If at the very bottom, and move the "Mobile Data > Set On (if %3GState = 1)" second from the bottom, just above closing.
I also just uploaded the xml file again to the main post.

Related

Data Auto Disconnect

I'm sure this is a noob question, but I can't find the answer on the forum.
I've seen a couple people reference automatically ending the data connections when they're idle. Can someone explain how this is done?
Is the desire to disconnect the data to save on battery life? Just curious. Thanks.
That's the main reason I want to do it...not sure about others...
I figured out two ways to do this for anyone else that's interested.
1) Using Advanced Config Tool (V3.3): Menu > More Settings > Connections. Check "Disconnect After" and set the timeout you want. This seems to work well for activesync connections (my mail is set to recieve every 5 min), but doesn't always work for on demand connections (Internet).
2) Comm Manager Pro. No instructions for this since I'm not using it (yet). But everything I've read looks like it does it.
Like I mentioned, I've got my email configured to sync every 5 minutes and I have a connection timeout of 30 seconds set in Advanced Config. This setup has drastically improved my battery life. Before this change, I got maybe 12 hours on a good day. With this timeout set, I could probably get 2 solid days. The only thing I haven't figured out is if the timeout is and idle timeout or an overall timeout. What I mean, is will the connection end after 30 seconds even if it's in use?
I'm interested in this as well, it would be even better if outlook or msn live would make a connection and disconnect after synchronizing.
I've been looking for the same solution. So far using advanced config settings will force disconnect no matter if it was idle or not. I'm looking for a solution to disconnect only when idle.
As of proof, set auto disconnect to 1 minute and using latest skype v3.0 start transferring a large file. After 1 minute data connection will be forcibly disconnected.
Any solutions for this?
Thank you.
Can someone help me find the timing setting in Advanced Config? I've looked through everything - using Energy 3.0 Rom (WM6.5) and don't see anything related to data disconnect other than under "Data Connections:" "GPRS disconnect:" and my settings are "Enable button and timer"
I don't see where the timer comes into play; don't really care if the connection gets cut off - I'd rather see a battery life improvement.....
I'm an absolute idiot. I just skimmed through the thread and didn't read the post above... *smacks forehead*
Its been posted in this very topic, and its only 5 replies long
xawen said:
I figured out two ways to do this for anyone else that's interested.
1) Using Advanced Config Tool (V3.3): Menu > More Settings > Connections. Check "Disconnect After" and set the timeout you want. This seems to work well for activesync connections (my mail is set to recieve every 5 min), but doesn't always work for on demand connections (Internet).
2) Comm Manager Pro. No instructions for this since I'm not using it (yet). But everything I've read looks like it does it.
Like I mentioned, I've got my email configured to sync every 5 minutes and I have a connection timeout of 30 seconds set in Advanced Config. This setup has drastically improved my battery life. Before this change, I got maybe 12 hours on a good day. With this timeout set, I could probably get 2 solid days. The only thing I haven't figured out is if the timeout is and idle timeout or an overall timeout. What I mean, is will the connection end after 30 seconds even if it's in use?
Click to expand...
Click to collapse
In advanced config the settings you are looking are not located in the list on first screen, the are in separate menu as described above.
And now I'll quote myself so my question will not get burred:
[email protected] said:
I've been looking for the same solution. So far using advanced config settings will force disconnect no matter if it was idle or not. I'm looking for a solution to disconnect only when idle.
As of proof, set auto disconnect to 1 minute and using latest skype v3.0 start transferring a large file. After 1 minute data connection will be forcibly disconnected.
Any solutions for this?
Thank you.
Click to expand...
Click to collapse
guys, found this
http://www.andrewsayshello.com/windows-mobile/auto-disconnecting-idle-data-connections-in-wm6/
hope this helps in some way
Thanks for the link, unfortunately it still disconnects even if data connection is in use.
WMLongLife can do this for you.
About the registry tweak that does this, I must warn you: it disables the ability to do voice and data simultaneously.
Chainfire said:
WMLongLife can do this for you.
Click to expand...
Click to collapse
Just checked WMLongLife and it seems that program does not quiet work if one doesn't use opera or wifirouter...
Chainfire said:
About the registry tweak that does this, I must warn you: it disables the ability to do voice and data simultaneously.
Click to expand...
Click to collapse
This is new for me...I thought that data connection cannot co-exist with phone call, period..
[email protected] said:
Just checked WMLongLife and it seems that program does not quiet work if one doesn't use opera or wifirouter...
Click to expand...
Click to collapse
Yes it does require a certain way of using your phone (current test version has specific settings - you can change this in next version). Just saying.
This is new for me...I thought that data connection cannot co-exist with phone call, period..
Click to expand...
Click to collapse
Yes it can, but it depends on several factors. Under ideal (and never actually occuring) conditions it can be done with 2G GSM (GPRS/EDGE). Normally, however, either GPRS/EDGE connection suspends ('pauses') during voice call, or with 2G CDMA voice call may not work at all while data connection active (depends on exact 2G CDMA network type).
With 3G GSM (UMTS/HSPA) it is quite possible (and normal) to do data and voice simultaneously, however for some reason the auto data disconnect registry tweak breaks it. I'm not quite sure why, but it does.
3G CDMA (EV-DO) behaves the same as 2G GSM with regards to simultaneous voice and data (data drops), however, EV-DO Rev. A behaves the same as 3G GSM (possible but broken by registry tweak)
Aside from this, it is also needed that your provider/network has the correct hardware to handle this. I'm not sure how common it is for this properly operating on EV-DO Rev. A, but for UMTS/HSPA early tower equipment was bugged and did not allow this. In Europe, most UMTS/HSPA towers have since been upgraded to allow simultaneous voice and data (and HTC handsets support this perfectly), but how this is in the USA I cannot say.
Hope that explains it (it is a bit messy explenation I know)
if this dowsn't work then i have no ideea what will )
http://forum.xda-developers.com/showthread.php?t=484084
tell me if worked for you
!!!!!
I had it set to disconnect (via Diamond Tweak software) after 1 minute of activity. I did this to preserve battery life, BUT BUT BUT
With 3g on, and even with 3g disabled all day and edge on, the battery still died in 8, 12 hours (3g, edge) with the connection disabling. i use the phone for a good number of calls, text, and some data every day.
AFTER i reenabled it to NOT disconnect after every 1 minute, i pulled over 24 hours on a SINGLE charge.
am i the only one that's experienced this??

Auto GPS comms switcher?

Has anyone heard or know of software that'll switch my WiFi on or off depeding upon where i am currently located using GPS? e.g. home or work? or wherever i've previously manually turned WiFi on and got a connection?
CMP
You should go for CMP - Commmanagerpro by Daniel Herrero
Its the most important program for a device running WM !!!
And I mean it.
Depending on cell towers and/or scheduled tasks it will change profiles, task and whatever you can think your device should do for you...
Exampel: My phones runs a close apps at 0100. At 0600 it reboots, turn on sound and let the alarm go. At 0730 the phone turns on and the screen becomes brighter. At 0800 a schedule starts, so IF CMP recons certain cell towers it turns on my Car profile. That one changes when I arrive at work to a work profile. Different sounds and lots more. IF my calender say I am in a meeting the screen will turn off and and sms will be sent to any that call me...
I have schedules for everyting. Nights - evening, weekend and wifi, tugging kids to bed and more....
So in short. CMP let you control whatever your device should do according to your position, the time of the day or your calender.
http://forum.xda-developers.com/showthread.php?t=299070
It has MANY details so it might take you some time to get deep with it, but from then it WILL become THE app of your device..trust me.
Thanks Martin, That looks like it does what i want, using cell phone masts is a much better idea than using GPS i guess.
However i'm put off slightly by the ugly skins and many details that will take me some time to get configured, i just want a simple background service that remembers what cell phone masts were responding when i get a successful authenticated wifi connection, and to use that information to turn wifi on the next time i'm in that area. The rest of my phone's profile such as back-light and ringtones etc i'm totally happy with managing myself as i'm not yet ready for my phone to be in control of my life! - i guess what i'm saying is the service shouldn't have any need for a configuration screen, and if it does, then it should be formatted and laid out in a standard way that doesn't look so scary or require me to identify my screen size before i download it!..
perhaps someone out there with more time on there hands than me could write this service and sell it on marketplace?!
CMP runs as a service
I couldn't resist the challenge.. i have written this as a tiny background service...
Wherever you turn your wifi on and get a connection, your phone will remember this and turn it on next time your there, also if you wander outside that 'connected' location and loose your wifi connection your wifi will be turned off until either you wander into a previously 'connected' location or turn it on manually... - turning it on manually and connecting to a wifi network will add that location etc etc... so no profiles, no config, no skins, no setup, no frills.. just plain handy.
if like me anyone is sick of wifi draining the battery when accidentally left on, or up sizing your phone bill when its accidentally left off, then get in touch and i'll slip you a copy to beta-test for me!
Cheers

[Q] Tasker profiles?

Not being of mathematical mind im having trouble understanding the settings in a tasker profile i want to create.
What i need is a rule that would
a) switch on wifi when the screen is switched on
b) switch off wifi 2 minutes after screen turns off
Help would be appreciated!
android does that automatically. when the screen is of wifi goes to sleep after a certain timeout (you can change that timeout using OCLF)
Tasker meh!
I brought Tasker with nearly the same enthusiasm as I had when I got my Android phone. I couldn't wait to start making it my personal butler, alas this wasn't the case.
Yes I maybe I'm a retard and I'm sure I'm going to burn in forum flames of hell, and I'm sure the developer has worked very hard on this and he/she should be congratulated as I would never be able to do what they have done. That aside I'm a paying customer so I am entitled to my opinion. Unless we have all turned into Apple pricks
I'm really disappointed with how poor this is. I feel the UI is very unintuitive, cheap and kind of ugly, I have no idea how to use it and haven't the time or patience to sit in for a week to learn how to. Even the website is the same tatty thing that I saw back in the early part of the year.
I feel a great improvement would be that I could just scroll through all the different pre-made tasks and profiles (in the app not a broswer) created by Joe public and approved by the developer and with a tap of a finger and bit of personalizing, bob is your uncle! away we go!
Just my penny as being a very satisfied customer.
I find it very useful, and not very difficult to understand.
It is simply a tool that will trigger an (set of) action(s) on a set (combination of) event(s), nothing more, nothing less, make it as complex as you want.
@ftgg99, if ou take a look at the tasker website, especially the Wiki, there are enough examples.
I am using tasker now for awhile, and have been able to setup a lot of useful profiles, like
- Auto switch on/off Wifi when i am near my home (based on Cell tower location)
- Auto switch off Wifi after 10 min of a lost connection
- Auto switch off Wifi 10 min after being switched on and no connection was made
- Start skype when wifi is connected, logout skype on wifi disconnect
- Have a incoming SMS read aloud when phone is connected to carkit
- Auto mute between 23:00 and 06:00 except for favourite contacts
- Auto mute when in a meeting
- Disable Auto rotate for certain apps (Ebook reading in bed is annoying otherwise)
- Auto Enable GPS for specific apps and disable afterwards
- Auto switch on Bluetooth when WiFi connection lost (probably going to my car)
- Auto switch off Bluetooth after 10 min of a lost connection
- Auto switch off Bluetooth 10 min after being switched on and no connection was made
stinkypete said:
I brought Tasker with nearly the same enthusiasm as I had when I got my Android phone. I couldn't wait to start making it my personal butler, alas this wasn't the case.
Yes I maybe I'm a retard and I'm sure I'm going to burn in forum flames of hell, and I'm sure the developer has worked very hard on this and he/she should be congratulated as I would never be able to do what they have done. That aside I'm a paying customer so I am entitled to my opinion. Unless we have all turned into Apple pricks
I'm really disappointed with how poor this is. I feel the UI is very unintuitive, cheap and kind of ugly, I have no idea how to use it and haven't the time or patience to sit in for a week to learn how to. Even the website is the same tatty thing that I saw back in the early part of the year.
I feel a great improvement would be that I could just scroll through all the different pre-made tasks and profiles (in the app not a broswer) created by Joe public and approved by the developer and with a tap of a finger and bit of personalizing, bob is your uncle! away we go!
Click to expand...
Click to collapse
When I first bought Tasker, I felt the same way. The UI felt difficult to understand and I couldn't really get it to do what I wanted. Every few weeks, I would redownload it and give it another try, then quickly give up. At some point, it started to make sense and I figured out how it all works.
Yes, Tasker has a large learning curve and the UI needs work, but the time it took to figure it out has been so well worth it.
stinkypete said:
<snip>
I feel a great improvement would be that I could just scroll through all the different pre-made tasks and profiles (in the app not a broswer) created by Joe public and approved by the developer and with a tap of a finger and bit of personalizing, bob is your uncle! away we go!
Click to expand...
Click to collapse
Part of the attraction of Tasker for me is that it's not centred around loading and personalising profiles from a public 'bank'. Yes there are profiles that people have shared, both on the Tasker website and in numerous threads on various forums. I treated these as learning examples, 'tutorials', and used them to gain an understanding of how to start writing my own profiles.
I've had Tasker about 3 / 4 months and have written approximately 15 profiles that have significantly changed how I interact with my N1, and how it interacts with my environment. These range from the very simple (reduce media volume when a wired headset is plugged in), to the horrendously complicated (workaround an issue with my bluetooth connection to my car kit).
I doubt whether I would have bothered to experiment to this extent if the focus had been on loading up and personalising publicised profiles.
I agree that the UI is perhaps less polished than other apps, however at most I would suggest that the dev has concentrated first on function over form. As a software developer who cut his teeth on mainframe COBOL I approve of that, particularly given the number of pretty but buggy apps on the market. Personally I care more about Tasker working correctly - I don't want my phone to ring during meetings if it's set not to - than looking pretty, as (in between tweaking profiles) I don't really see the app itself.
Sorry it took a while to read these replies!
Anywho, i now have had a different idea - tasker should switch on wifi, check if a known network exists and if it does connect. If not it should switch wifi off.
ftgg99 said:
tasker should switch on wifi, check if a known network exists and if it does connect. If not it should switch wifi off.
Click to expand...
Click to collapse
Which is exactly what the WiFi Near Profile does,
with the time interval for each check being possible to set to your own liking.
However, you adding additional restrictions based on the cell-near could save some useless scanning. Usually Wifi Access points have a fairly static location don't they, so why do a WiFi Near scan if you are not at your home/work/collage anyway.
daoth said:
- Start skype when wifi is connected, logout skype on wifi disconnect
Click to expand...
Click to collapse
How did you achieve the logout on wifi disconnect? I can't get Tasker to kill apps, which is said to be a common problem under the latest FroYo stock ROMs (at least for my Desire HD)
I don't have root access btw, since that requires me to downgrade my ROM first, which would cause me to loose my warranty...
daoth said:
Just my penny as being a very satisfied customer.
I find it very useful, and not very difficult to understand.
It is simply a tool that will trigger an (set of) action(s) on a set (combination of) event(s), nothing more, nothing less, make it as complex as you want.
@ftgg99, if ou take a look at the tasker website, especially the Wiki, there are enough examples.
I am using tasker now for awhile, and have been able to setup a lot of useful profiles, like
- Auto switch on/off Wifi when i am near my home (based on Cell tower location)
- Auto switch off Wifi after 10 min of a lost connection
- Auto switch off Wifi 10 min after being switched on and no connection was made
- Start skype when wifi is connected, logout skype on wifi disconnect
- Have a incoming SMS read aloud when phone is connected to carkit
- Auto mute between 23:00 and 06:00 except for favourite contacts
- Auto mute when in a meeting
- Disable Auto rotate for certain apps (Ebook reading in bed is annoying otherwise)
- Auto Enable GPS for specific apps and disable afterwards
- Auto switch on Bluetooth when WiFi connection lost (probably going to my car)
- Auto switch off Bluetooth after 10 min of a lost connection
- Auto switch off Bluetooth 10 min after being switched on and no connection was made
Click to expand...
Click to collapse
How did you get wifi to switch off when its not connected to any network, occasional i leave the house and i forget to switch wifi off. I tried location based wifi off but it wont be as fast or accurate as switching off wifi when theirs no connection after lets say 1-2 minutes. I considered getting another app to do this after i tried to get it to work with tasker, but i have enough apps running in the background.
Do any of you leave gps turned on always so that tasker works better with locations? for me with just network location it can take some time to update and to turn on a profile.
arielc said:
Do any of you leave gps turned on always so that tasker works better with locations? for me with just network location it can take some time to update and to turn on a profile.
Click to expand...
Click to collapse
That may be linked to timings of background context checks when the screen is off.
Personally I always leave GPS on, but only use Net location / Cell IDs for my Tasker location contexts.
If anyone wants any ideas on Tasker profiles or want to know how to do something just go to my blog at http://dbilliter.blogspot.com. I update it regularly and will continue to try and improve the Profiles.
dbilliter said:
If anyone wants any ideas on Tasker profiles or want to know how to do something just go to my blog at http://dbilliter.blogspot.com. I update it regularly and will continue to try and improve the Profiles.
Click to expand...
Click to collapse
Thanks for the work...
The tasker website have some codes
http://tasker.wikidot.com/step-throughs
People please post more codes... would love to see more
drgopoos said:
Thanks for the work...
The tasker website have some codes
http://tasker.wikidot.com/step-throughs
People please post more codes... would love to see more
Click to expand...
Click to collapse
I am posting one everyday this week and I think I have a couple more. I will post even more whenever I either come up with new ideas or someone gives me a new idea.
Ok, I have a very basic understanding of tasker. I actually was able to make my gps app turn on the gps when being executed. I only added gps off exit task after reading the wiki. However, I'm trying to find a way to do the following:
when selecting pandora icon (I say icon, as I may need a pointer to the actual app)
verify wifi connection status - if connected, then load pandora app; if not connected, kill pandora app (might be redundant but just in case)
I also need to create a general wifi connection status, such that if connection is lost, kill specific running apps (such as pandora; could add more later)
I tend to fall asleep using headphones and pandora. I'd REALLY hate to find out that my cable/wifi went down while asleep and I've just been listening to pandora using cell data for several hours.
Now, making a profile to turn on wifi is easy enough, but not sure how to do the above. I'd imagine it'd be something like:
If [pandora app] initiated
wifi_connected = 1 (or yes or whatever)
then load [pandora app]
any help would be appreciated
EDIT: Nevermind. Though knowing more about how variables are used in TASKER would be interesting (I'll play around with them some more), I found out that with wifi ON, cell data usage is cut off. I disconnected my cable connection and with wifi still on, I couldn't connect to anything. So worry was unfounded, it turns out.
dbilliter said:
If anyone wants any ideas on Tasker profiles or want to know how to do something just go to my blog at http://dbilliter.blogspot.com. I update it regularly and will continue to try and improve the Profiles.
Click to expand...
Click to collapse
thanks once again.. am testing out a few of them
drgopoos said:
thanks once again.. am testing out a few of them
Click to expand...
Click to collapse
No problem. It is a hobby for me. I love doing it so I thought I would create a blog with the focus on Tasker to help people along. I know there are a number of other sites but I have been trying to make mine as basic as possible so that anyone could figure it out.
Some actual description of what the tasker profiles do would be very helpful... also less tit shots so that I don't catch crap for looking at the site from work would be nice.
dbilliter said:
No problem. It is a hobby for me. I love doing it so I thought I would create a blog with the focus on Tasker to help people along. I know there are a number of other sites but I have been trying to make mine as basic as possible so that anyone could figure it out.
Click to expand...
Click to collapse
I was trying to make 2 profiles
Profile 1 - I have set up a profile so that when i plug in a headphone with no mic ( and no mic in options ) , it opens the music app
Profile 2 - i have also set up another profile , when i plug in a Headset with mic ( and mic in options) , it opens the dialer.
However when i plug in the headset it opens both the Dialer and music app . Is there a way to prevent the music app from opening.
drgopoos said:
I was trying to make 2 profiles
Profile 1 - I have set up a profile so that when i plug in a headphone with no mic ( and no mic in options ) , it opens the music app
Profile 2 - i have also set up another profile , when i plug in a Headset with mic ( and mic in options) , it opens the dialer.
However when i plug in the headset it opens both the Dialer and music app . Is there a way to prevent the music app from opening.
Click to expand...
Click to collapse
Sorry for the delay. I don't know of a way personally. I can only work with what I got and I don't have a headset with a mic so I have no way of testing. One option you could do though is have a menu pop up and ask you which you want.

wifi sleep policy improvement

Hi all
Thinking about the Wifi Sleep Policy settings:
I could not find the exact details of what the different options mean, but with a little common sense:
a) When screen turns off :
- if you have a wifi connection established : When the screen times out, it will turn off wifi and swith to mobile data.
- if you do not have a wifi connection established : The phone is constantly scanning for known wifi networks. When the screen times out, it will turn off wifi and stop all scanning.
b) Never :
- if you have a wifi connection established : when the screen times out the phone will keep that connection.
- if you do not have a wifi connection established : The phone is scanning. When the screen times out, it will keep wifi ON and continue to scan permanently for known networks.
c) Never when plugged in: it is not very clear, but would say its b) if the phone is charging, and a) if the phone is not charging.
Thinking a bit about this, it appears to me that none of this options is the ideal situation.
I would say that the ideal situation is that if I have a wifi connection established, then keep wifi on and the connection for as long as the network is there.
But if I do not have a connection established, I would like the phone to turn off the wifi interface, and turn off all scanning so as not to drain the battery while I am on the streets away from home. Then only begin scanning when I turn the screen back on, and if it no wifi network to connect, then turn off wifi again when the screen times out.
In other words, I think the best situation is a mix of behaviours of a) when there is no wifi connection established, and b) if there is a wifi connection established.
Does this make sense ? or am I crazy? I'd like your opinions please.
Anybody thought about this before? Is there any app or mod that will implement this behavior ?
Thanks
Gonzalo
gbalerdi said:
Hi all
Thinking about the Wifi Sleep Policy settings:
I could not find the exact details of what the different options mean, but with a little common sense:
a) When screen turns off :
- if you have a wifi connection established : When the screen times out, it will turn off wifi and swith to mobile data.
- if you do not have a wifi connection established : The phone is constantly scanning for known wifi networks. When the screen times out, it will turn off wifi and stop all scanning.
b) Never :
- if you have a wifi connection established : when the screen times out the phone will keep that connection.
- if you do not have a wifi connection established : The phone is scanning. When the screen times out, it will keep wifi ON and continue to scan permanently for known networks.
c) Never when plugged in: it is not very clear, but would say its b) if the phone is charging, and a) if the phone is not charging.
Thinking a bit about this, it appears to me that none of this options is the ideal situation.
I would say that the ideal situation is that if I have a wifi connection established, then keep wifi on and the connection for as long as the network is there.
But if I do not have a connection established, I would like the phone to turn off the wifi interface, and turn off all scanning so as not to drain the battery while I am on the streets away from home. Then only begin scanning when I turn the screen back on, and if it no wifi network to connect, then turn off wifi again when the screen times out.
In other words, I think the best situation is a mix of behaviours of a) when there is no wifi connection established, and b) if there is a wifi connection established.
Does this make sense ? or am I crazy? I'd like your opinions please.
Anybody thought about this before? Is there any app or mod that will implement this behavior ?
Thanks
Gonzalo
Click to expand...
Click to collapse
Sleep Policy is pretty simple:
Never means the wifi radio is never turned off. This is default now on Honeycomb and up, with fairly good reason.
When screen is off means.. the radio is turned off when the screen goes off regardless of whether you have a connection.
Only when plugged in means that the wifi radio is only turned off when the screen is off and it's not plugged in.
Sounds like you want Tasker http://tasker.dinglisch.net/
It will let you do what you describe.
Juice Defender will, as well, but it's terrible terrible software.
As to your problem, on most devices, scanning is usually reduced quite a bit when the screen is off. It's not as much of a battery drain as people think.
I'm in the habit of disabling wifi when I'm not at home or in the office. There's really no reason to leave it on when you're not going to be using it unless you want open network notification.
Thank you , I didn't know that the default is now Never. I'll set it this way.
And I guess I don't really have a real life problem, it's just that it got me thinking and came to the conclusions above.
And thanks for the link to the app, I will check it out.
Gonza
edit: oh I see you are the wifi fixer dev. Thanks so much for both replies.
Is your phone rooted? Do you have root explorer and sqlite installed. Then you can have more control over the time wifi goes to sleep after screen is turned off.
BUT: it remains on for 15 minutes by default.
Now start root explorer. Navigate to
/data/data/com.android.providers.settings/databases and open settings.db
If you have sqlite installed you seesome tables. Open secure table.
Add New record. name is wifi_idle_ms and give it a value in milliseconds you want.
Default (if wifi_idle_ms is not present) is 15*60*1000 ms. I have 60000 (1 minute)
Cheers
I use juice defender. Why is it such a terrible software? I've not used others, so I have no means of comparison. Perhaps you can enlighten me?
ZanshinG1 said:
Sleep Policy is pretty simple:
Never means the wifi radio is never turned off. This is default now on Honeycomb and up, with fairly good reason.
When screen is off means.. the radio is turned off when the screen goes off regardless of whether you have a connection.
Only when plugged in means that the wifi radio is only turned off when the screen is off and it's not plugged in.
Sounds like you want Tasker http://tasker.dinglisch.net/
It will let you do what you describe.
Juice Defender will, as well, but it's terrible terrible software.
As to your problem, on most devices, scanning is usually reduced quite a bit when the screen is off. It's not as much of a battery drain as people think.
I'm in the habit of disabling wifi when I'm not at home or in the office. There's really no reason to leave it on when you're not going to be using it unless you want open network notification.
Click to expand...
Click to collapse
androidapk.net said:
I use juice defender. Why is it such a terrible software? I've not used others, so I have no means of comparison. Perhaps you can enlighten me?
Click to expand...
Click to collapse
I'd like to hear that opinion too
JD is not terrible terrible. It is terrific terrific. Honest, it really work flawlessy and it does pretty well what the OP wants. Just for the sake of it, I'm trying to replicate with tasker what JD does, but, you know... it just does it better.
tweakradje said:
Is your phone rooted? Do you have root explorer and sqlite installed. Then you can have more control over the time wifi goes to sleep after screen is turned off.
BUT: it remains on for 15 minutes by default.
Now start root explorer. Navigate to
/data/data/com.android.providers.settings/databases and open settings.db
If you have sqlite installed you seesome tables. Open secure table.
Add New record. name is wifi_idle_ms and give it a value in milliseconds you want.
Default (if wifi_idle_ms is not present) is 15*60*1000 ms. I have 60000 (1 minute)
Cheers
Click to expand...
Click to collapse
Thank you! Yes I am rooted, I am running CM7 latest kang, but I did not know all this.
Gonna give it a try
Interesting. It works indeed! If one knows a bit about Unix shell, I did the modification via adb shell. Obviously the phone must be rooted and have sqlite3 (the binary) installed.
This is how to do it:
- connect the phone via USB to the PC
- execute "adb shell" (adb must be installed) from the DOS prompt. You are into the phone
Then execute the following steps:
Code:
su
cd /data/data/com.android.providers.settings/databases
cp settings.db settings.db.ORIG
sqlite3 settings.db
Now you are "inside" the db. Type ("sqlite>" is just the prompt):
Code:
sqlite> select * from secure;
and check if wifi_idle_ms is not present. If it isn't, as it shouldn't, type:
Code:
sqlite> insert into secure values(60,'wifi_idle_ms',30000);
where instead of 60 you can write any number that is not used already in the list, being that the unique key in the table.
I used 30000 (30000 microseconds = 30 ms) but one can put the value s/he prefers.
Miche1asso said:
Interesting. It works indeed! If one knows a bit about Unix shell, I did the modification via adb shell. Obviously the phone must be rooted and have sqlite3 (the binary) installed.
This is how to do it:
- connect the phone via USB to the PC
- execute "adb shell" (adb must be installed) from the DOS prompt. You are into the phone
Then execute the following steps:
Code:
su
cd /data/data/com.android.providers.settings/databases
cp settings.db settings.db.ORIG
sqlite3 settings.db
Now you are "inside" the db. Type ("sqlite>" is just the prompt):
Code:
sqlite> select * from secure;
and check if wifi_idle_ms is not present. If it isn't, as it shouldn't, type:
Code:
sqlite> insert into secure values(60,'wifi_idle_ms',30000);
where instead of 60 you can write any number that is not used already in the list, being that the unique key in the table.
I used 30000 (30000 microseconds = 30 ms) but one can put the value s/he prefers.
Click to expand...
Click to collapse
Thanks to Miche1asso for the commands, you've made my day :good::fingers-crossed:
This thread is good, useful, it did help up reduce the default wifi idle timeout :good: Just tested on xperia sola, perfect on my custom idea idle timeout (to 120000ms)

[Q] Turning off cellular modem without turning off WiFi

Hi all!
I just recently upgraded from a Samsung Galaxy Player 4.0" to a Moto G. I sold my SGP and accessories for almost what I paid for my Moto G, which I considered a pretty good deal. I currently have no need for a cell phone, however, and merely use the Moto G as I did the SGP. That means connecting with WiFi only and using it mostly as a media and navigational device (with pre-downloaded maps and GPS enabled).
In an attempt to conserve as much of the (already amazing) battery life as possible, I've set location to Battery Saver and disabled "Data enabled" and "Data roaming" under Settings>Wireless & networks>Mobile network settings. I've also set "Battery Saver" under Settings>Battery to "On". Despite this "Cell standby" under Settings>Battery still consumes an average 20% of a full charge of my battery. Part of this could be that as I am in a remote location, with only very weak cell signals available, the device is constantly searching for signal despite the fact that I do not even have a SIM card installed.
Is there any possible manner in which I could switch off the cellular modem in the phone without switching off WiFi? I can set the device to "Airplane Mode" but that also turns off WiFi, which I prefer to leave on during the day and only switch off at night. I am very new to Android 4.x, so do not yet know all the ins and outs of the Settings menu, and as such may be missing something. Or there might just not be the option. Either way, is what I am wanting to do possible?
You can turn WiFi back on (long press it in the quick settings tile) after enabling Airplane Mode. There may be an app or widget to do this more seamlessly, though.
Turn OFF cellular radio.
I can't wait for my Moto-G to arrive, so I am winging it here..
You can try this: *#*#4636#*#*, and you will enter the TEST mode.
Select Phone information, and scroll down to where you see the SMSC dialog box, directly above this, you will see another greyed out box with the wording: Turn off radio. Select that, and the radio will be disabled, but will restart on a reboot, but there is a way to shut off the radio completely as well, but this should help for now.
You can also use this: ##7764726(program) and then tap DIAL to access the SPC password menu, where you enter SIX ZEROES, and tap 'verify' to enter the programming menu.
The two you will be more interested in, are the first and third selections, User activation and Extended NAM
You can wipe all the data if you wish (but write that information on paper so you will know its location if you decide to actually use that device in the future!
Scroll down to Extended NAM and write that information down, first to last, in proper order as before.
If you wish to completely disable ALL outbound dialing, you should delete the emergency number listings as well.
To upgrade your overload class, change that number to a '1', so some schmuck can't boot your call in favor of theirs.
Your MIN and MDN should be erased, as this prevents the phone from placing any calls, even 911 calls if you erased those numbers.
You can erase everything, from the SID to the MCC (Mobile Country Code), to anything the phone uses to access the network.
Just write everything down in proper order so you have a point of reference when you forget what you did.
Once you finish your task, reboot the device. You may need to once again, shut off the radio using the *#*4636#*# operation, but each device is unique here, you may not need to do this.
You can then try the above mentioned shut down procedure again, and disable the radio completely.
WiFi should still be operational
Thank you both very much for your replies! tma200's method works quite well for me, being easy to get to (definitely seamless compared to doing anything in Gingerbread!) and simple to remember. Thank you for your reply, AECRADIO, I'll keep it in mind if I ever need to do some more advanced radio management on my device!

Categories

Resources