Is it possible to use Tasker or a similar app to automatically Airplane toggle when data drops from an AOSP ROM? That is, can an app like tasker "know" when data drops and be configured to toggle it back on?
Sent from my SCH-I535 using xda app-developers app
I would like to the same thing that could be very helpful
I'm not on AOSP but you could try: Make a profile for signal strength from 0 to 1 ( not 100% sure that these are the values needed ). Then a task that sets airplane mode to off then waits maybe 10 sec. and turns it back on.
Related
Hello, ive been trying to make an app that turns mobile data off if screen has been off for x minutes and turns data back on if screen comes on when data is off. Is that possible? I cannot seem to do it.
Thank you in advance!
Sent from my ADR6400L using Tapatalk
This might work:
1st Context, State: Screen off with the following tasks:
1. Variable set %SODATA = 1
2. Wait 30 mins
3. Mobile data = off IF %SODATA = 1
4. Variable set %MODATA = 0
2nd Context, State: Screen on
1. Variable set %SODATA = 0
2. Mobile data = on IF %MODATA = 0
Important
Screen off context must have a lower priority than Screen on context. Also, collision handling of Screen off context must be set to "Abort existing task".
Also, the Tasker userguide says
Mobile Data
Set mobile data status without affecting incoming calls.
This action has the disadvantage that Android may manipulate it internally when certain things happen e.g. wifi disconnected.
Note: this action requires that Mobile Data is intitially turned *on* in Android System Settings.
When Mobile Data is *off* in System Settings, this action will have no effect.
It has been reported that many Google apps reenable the setting.
Click to expand...
Click to collapse
So you might consider using APNdroid or JuiceDefender tasks instead of Mobile Data task.
P.S. I haven't tried this out (and can't at the moment). Just thought of this off the top of my head. So they might not work at all.
State screen off means event display off right?
Sent from my ADR6400L using Tapatalk
Yup, that's right.
Ok thank you but no, it didnt work
Sent from my ADR6400L using Tapatalk
Which part didn't work? Let's try to make this work
Lol well im not sure, i changed the delay to ten seconds to test it and the data never went off. Idk what about that didnt work because im an idiot at tasker but the data doesnt go off. lol
Sent from my ADR6400L using Tapatalk
How are you checking that data is off when the screen turns off?
How about try to change the event from display off/on to something else. Like headset plugged/unplugged.
Ok, ill try that when i get a chance.
Sent from my ADR6400L using Tapatalk
Did not work with headset plugged and unplugged either, data still not turning off
Sent from my ADR6400L using Tapatalk
If i leave the vaiables out it works perfect
Sent from my ADR6400L using Tapatalk
Hmm interesting. I placed the variables there as sort of a "safety net". I've been trying out the profile on tasker (finally got my phone back ) and got it working but I used APNdroid+Tasker because I couldn't get the data back on once it automatically disabled using the 'mobile data' task.
Glad to hear you got it working by yourself.
Thank you sobmuch for your help
Sent from my ADR6400L using Tapatalk
What is the purpose behind the wifi sleep policy. I flashed to gingeritis and it recommends setting the sleep to 15mins for battery life. It appears to go back to the 3G/4G radio when wifi goes to sleep which I thought was counter productive and wiFi was better for battery life. Can any explain this to me?
I can't say this works for everyone, but I have "enable always on mobile data" disabled, so when I don't use my phone for 10 minutes or so it disables mobile data. If I have the WiFi sleep period set to 15, then it will disable all data in 10-15 minutes. Very useful if you have extended periods of time where your phone remains off.
geoff5093 said:
I can't say this works for everyone, but I have "enable always on mobile data" disabled, so when I don't use my phone for 10 minutes or so it disables mobile data. If I have the WiFi sleep period set to 15, then it will disable all data in 10-15 minutes. Very useful if you have extended periods of time where your phone remains off.
Click to expand...
Click to collapse
How do you disable mobile data all the time?
Sent from my ADR6400L using XDA App
Powell730 said:
How do you disable mobile data all the time?
Sent from my ADR6400L using XDA App
Click to expand...
Click to collapse
hold down the power button
Powell730 said:
How do you disable mobile data all the time?
Sent from my ADR6400L using XDA App
Click to expand...
Click to collapse
HTC supplies a data widget that I use every day while I am at work. Go to personalize, then browse all HTC widgets and the data widget I use is the Data Dashboard. Its 43/58 on my phone but mine might not be right on as I remove a few of the widgets.
While I am at work I just click the mobile setting on the widget to turn data off while still maintaining my voice connect so I can receive txt and phone calls.
As for the OP I keep my wifi set to never sleep no matter what rom I'm on. This way when I'm at home my phone doesn't have to look for the network its always connected to my wifi access point. I have always heard the same as the OP that having wifi on is much better than using the network as far as battery life is concerned.
Setting wifi sleep policy to never is best for battery life. Letting the phone switch back to 3g uses more battery than just letting it stay on wifi all the time.
RogerPodacter said:
Setting wifi sleep policy to never is best for battery life. Letting the phone switch back to 3g uses more battery than just letting it stay on wifi all the time.
Click to expand...
Click to collapse
Thank you that's what I thought!
Cell Standby Battery Drain:
Hey Guys!!
Maybe some of you know it. The cell standby drains a lot of battery. I live in a mounterial arrea and it's really annoying. So I searched a bit on Google and build a small Tasker "Script" to reduce the draining. I'm using it now for 6 weeks and it's working good! It reduced my cell standby from 35% to 2%.
So what's the magic?
First tasker will turn Airplane Mode (only cell!) on if you don't have signal. Then it'll wait for 5 minutes and check it again. Yes this sounds really simple but it was hard to build it.
I hope I can help you with sharing my experiences!
Screen off=data/wifi off it no traffic (with Night Mode):
Hey Guys, I have been looking for a solution for this problem for quite a while myself. Now I found a good solution to collect the current traffic on all interfaces. I will share a detailed explanation on how to set it up.
First off, what will happen?
If you want tasker to turn Wifi or Mobile Data off when you the turn Screen off normally you have the problem that it will interrupt all downloads. This Profile will try to read the traffic. If the traffic is below 15 kb it will turn wifi or mobile data off. If not it’ll wait until it is below 15kb. Later If you turn your screen on again tasker will activate mobile data and wifi. It'll wifi doesn't connect to a network (in the next 30 seconds) it will turn wifi off.
How does Tasker work? How can I optimize these profiles/tasks for my needs?
First what does tasker do? This is for the people who don't understand tasker. Tasker has 4 tabs (Profiles, Tasks, Scenes and Vars) but I won't talk about Scenes cz I didn't uses it yet. I also won't talk about Vars (variables) cz they are self explaining.
What are Profiles?
Basically profiles contain conditions (for example if display on/off or wifi on/off) and run a task if the condition is true. Example: If display off turn wifi off.
What are Tasks?
A task is something like a list of actions which the phone should do. (for example turn data on/off or run a specific app)
How do the profiles from this thread?
The profile AutoSync (Screen off) runs every 10 minutes while the screen is off. It turns data/wifi on checks for new messages and turns it off. It has a variable called "%SLEEP". It will only run if "%SLEEP" doesn't match "1".
The profiles Display (Data) and Display (Wifi) turns data/wifi on when the user turns the screen on. When the screen is off again it will check traffic for 30 seconds. If the traffic is below 15kb/s it will turn data/wifi off. If not it will wait 2 minutes and check the traffic again for 30 seconds until the traffic is below 15kb/s.
The profile Night (week), Night (weekend) turn the phone into airplane mode and sets the variable "%SLEEP" to "1".
The profile Wifi connected just changes the variable "%CONNECTION to "1" or removes the "1". This is needed for the Display (Wifi) profile.
On my todolist:
You say..
Changelog v1.3:
Added Greenify's hibernate now to both screen off tasks
Changelog v1.2:
Added AutoSync (every 10 minutes if screen is off)
I'm using this profiles on my Samsung Galaxy Nexus and it works very well!!
Feel free to ask me if you have problems! I'll try my best to help you.
These profiles include the greenify hibernate action from its plugin. If you have troubles with it you have to remove and readd it (on both Screen off tasks) cz my plugin is german. (plugin → hibernate)
You need Secure Settings for tasker or it won't work!! I used Secure Settings because Secure Settings can off only the cell radio. Tasker supports it, too. But not for Jelly Bean and I'm using 4.2.2 :/
How to import *.prj.xml files:
Unzip the *.prj.xml file in your Tasker/projects directory and then import it in Tasker by long-clicking the home icon or any of the other tabs. If you don't have the home tab, swipe down from the top in Tasker to show the tabs. (beginner mode must be disabled!)
Thanks for this 8D!
Useful for a beginner like me ^^!
In task screen off, why do you wait for 30 sec's in Action number 5? Also how important is the Stop Task Action? What happens if I don't include it? I mean anyways, the following 'else' won't be executed if the Mobile data turned off by the 'if'.
Just what I looked for, but How can I install your *.zip file to tasker? I just cant install it, any hint? where should I put the zip file?
kala123 said:
Just what I looked for, but How can I install your *.zip file to tasker? I just cant install it, any hint? where should I put the zip file?
Click to expand...
Click to collapse
unzip it to /sdcard/Tasker/auto-import. Then import it using tasker.
The-Droidster said:
In task screen off, why do you wait for 30 sec's in Action number 5? Also how important is the Stop Task Action? What happens if I don't include it? I mean anyways, the following 'else' won't be executed if the Mobile data turned off by the 'if'.
Click to expand...
Click to collapse
You have to wait 30 seconds or how long you want to wait cz in action number 2 tasker gets a traffic number from the system. After 30 seconds it gets another. Tasker subtracts the values to get the actual traffic in bytes. So Tasker can look if the traffic is below 15 kb/s. Yes you're right. It's my fault. You don't need the Stop Task Action. It's from the old Script. I forgot to remove it. Thanks for your hint!
Hi parthipanramesh,
what I metioned inside the other Thread seems to be working A okay...
What are the modifications/fixes in this version? I can't tell from looking at it here.
RLicher said:
Hi parthipanramesh,
what I metioned inside the other Thread seems to be working A okay...
What are the modifications/fixes in this version? I can't tell from looking at it here.
Click to expand...
Click to collapse
Hi RLicher,
Some people had the issue with the maths calculation of CHECKB_WIFI - CHECKA_WIFI. So tasker will set the variables to 0 if they aren't set. (cz wifi is off or something else). And I deleted/merged some Actions.
You can use the version from the other thread if you don't have problems
I'm using this on SGS3 but notice two issue... While listening to Pandora when a song ends the data or wifi will get disabled so the next song cant start. Second wifi or data will not be reenable when the screen is enabled.
For the record i just imported the files within the zip.
nappent said:
I'm using this on SGS3 but notice two issue... While listening to Pandora when a song ends the data or wifi will get disabled so the next song cant start. Second wifi or data will not be reenable when the screen is enabled.
For the record i just imported the files within the zip.
Click to expand...
Click to collapse
First you have to increase the 30 seconds from the two Screen off tasks [A5] because Tasker checks the traffic for 30 seconds. If Pandora loads a song for example in 40 seconds Tasker will disable data and wifi after it has been loaded. So data and wifi are turned off when Pandora tries to play the next song. Increase the value and you should be good.
And for your next issue:
Delete the imported profile and create a new profile:
Name: Whatever
Context: State → Display On
Task: Create a task which enables data and wifi
Exit Task: Screen off
Re: Tasker solution: Screen off=wifi/data off if no traffic
The-Droidster said:
unzip it to /sdcard/Tasker/auto-import. Then import it using tasker.
Click to expand...
Click to collapse
How do we import?
Sent from my SGH-T999 using xda premium
ktetreault14 said:
How do we import?
Sent from my SGH-T999 using xda premium
Click to expand...
Click to collapse
Sorry I didn't read your previous post.
Unzip the *.tsk.xml files to sdcard/Tasker/tasks and the *.prf.xml to sdcard/Tasker/profiles. Then open tasker tap on tasks and hold it until a menu appears. Tap on import and you should see the files. Do this for the profile aswell.
First tasks and then profiles!! Or you'll get an error that tasker couldn't find the the task for the profile.
Thanks just pinched your files and made it turn on when the screen comes on.
My current profiles means that Wifi turns off when i leave the office and stays off until I turn it on again.
If im somewhere with no wifi will my wifi be turned on when my screen is turned on?
Would i need to create another profile which says if wifi is on and not connected to a network after X minutes
then please disable?
If so is that an easy one to create?
Thanks
Andy
Iceax123 said:
Thanks just pinched your files and made it turn on when the screen comes on.
My current profiles means that Wifi turns off when i leave the office and stays off until I turn it on again.
If im somewhere with no wifi will my wifi be turned on when my screen is turned on?
Would i need to create another profile which says if wifi is on and not connected to a network after X minutes
then please disable?
If so is that an easy one to create?
Thanks
Andy
Click to expand...
Click to collapse
First yes it will enable wifi.
I solved it with 2 profiles. One changes a variable if wifi is connected or not and the other one is turns wifi on, waits 30 seconds, checks the variable. If my phone is not connected to a wifi it will turn it off.
Do you want my profiles?
Re: Tasker solution: Screen off=wifi/data off if no traffic
Yes please that would be excellent
Thanks
Andy
Sent from my HTC One X using xda app-developers app
Re: Tasker solution: Screen off=wifi/data off if no traffic
Just one last question if I may.
Using this if I turn of data as well will that stop any emails coming in.
I have 3g turned off so am always on 2g but would still want push mail from one account to get through
Thanks
Sent from my HTC One X using xda app-developers app
Also found another issue now
I have a rule set up so when connected to works wi-fi my ringer and notifications are set to low.
But now when i turn my screen off wifi drops and my volume goes up. ARGHHHHH
Andy
Iceax123 said:
Yes please that would be excellent
Thanks
Andy
Sent from my HTC One X using xda app-developers app
Click to expand...
Click to collapse
Look in the OP!! New version
Iceax123 said:
Just one last question if I may.
Using this if I turn of data as well will that stop any emails coming in.
I have 3g turned off so am always on 2g but would still want push mail from one account to get through
Thanks
Sent from my HTC One X using xda app-developers app
Click to expand...
Click to collapse
Yes it will turn generally data off. 2g or 3g it doesn't matter.
Iceax123 said:
Also found another issue now
I have a rule set up so when connected to works wi-fi my ringer and notifications are set to low.
But now when i turn my screen off wifi drops and my volume goes up. ARGHHHHH
Andy
Click to expand...
Click to collapse
It have nothing to do with my profiles and tasks. They only enable connections, check traffic and disable the conncections. Maybe another profile isn't working correctly.
And next time you can edit your post. You don't need to make 3 posts.
Thanks again parthipanramesh, will import these tonight and try
Andy
I am new to tasker and i have been fiddling with it.
How would I add auto sync turns on every 15 minutes when screen is off and auto sync turns on when screen is on to this "script"?
Is there a way so that when the battery dips below a certain threshold the phone can automatically disable things like Bluetooth or GPS to save battery? Is something like this built into JB (I'm on CM 10) or is there an adequate app for this functionality?
Hmm...I think there is. Try going to settings, profiles, and change up or play around with the default/home/work... settings. You can toggle WiFi, mobile data, Bluetooth... Etc
Sent from my HTC Sensation using xda app-developers app
Tasker (app) does it. I think Llama does also and is free.
Reboot your phone, then see how long after your android desktop comes up that the tasker notification shows up.
I seem to have an issue where it takes like minutes, and only shows up after I lock/unlock my phone. This is new to KK for me, I'm running completely standard, no task managers or anything, just curious if its the same for anyone else.
Mine takes around 15 seconds
Sent from my XT1032 using xda app-developers app
No for me. All good here. en.EU.
I barely can tell the difference between the startup times with and without Tasker.
Sent from my XT1032 using xda app-developers app
What about battery consumption with and without tasker?
michalurban said:
What about battery consumption with and without tasker?
Click to expand...
Click to collapse
I can not tell, some of my Tasker stuff is about battery conservation (turns off mobile data and switches to 2G at home and work, switches to 3G and turns off the wifi outdoors, puts the phone to airplane between midnight and 5AM etc.) or messes up my battery stats (for example keeps the screen alive when USB debugging is connected) Of course it needs some juice, but it conserves me even more.
Mine takes about 15 seconds also