yashsingh1/xdaforums huggingface dataset:
[Android Software Development] brandall:
Good spot - have credited you on V3.1 change log. Keep up the good testing! Oh, and if you're feeling really brave after, check my signature for the media control tutorial - no one's been brave enough yet....... :eek:
[Android Software Development] torsrex:
Will look at it tomorrow. ;) It is like you once said: "Tasker gets addictive"! :p
[Android Software Development] brandall:
Ha! Damn right... Until tomorrow...
[Android Software Development] lodder:
I have setup a profile that uses the state mobile network with 2g/3g/4g checked. using an entry and an exit tasks controling to wether it's on or not!

I have change the settings to mobile network APN to have it working with APNdroid

And one more thing In your "autosync" profile you have a variable %INCALL is a tasker variable? or do you have to set it manually!
[Android Software Development] brandall:
Good work - please zip up the file and post as others may wish to use. Is there an advantage to using APNdroid? How often is the 2g/3g/4g Tasker profile active?

The %INCALL variable is actually set to different values in my CPU profiles here. I included it in these profiles to prevent 2g/3g switching during a call. If you're not using those (why not!? ;) ), they are simple profiles to create:

'Event' - 'phone-offhook' - In the task - variable set %INCALL = 2 - STOP

'Event' - Phone Idle' - In the task - variable set %INCALL = 1 - STOP

Hope these are working for you?
[Android Software Development] lodder:
Thx for the INCALL explanation, I thought they where internal variables.

For the APNDroid there is no difference the functionality remains the same.

I have changed it back so I don't APNdroid to turn on the mobile internet, I'm using the ZDbox switch widget so I can switch it on when ever I need it.

I also changed it to leave the wifi on when running task AutoSync when there is no wifi found just incase I get in range of one.

The 2g/3g/4g Tasker profile remains constantly active while mobile internet is on. it doesn't seem to be a difference when change from 2g to 3g.

So in short the changes are:

leave mobile network when on before autosync, using new profile

removed switch 2g/3g in autosync

removed wifi off if no wifi is found, it will be turned off at the end of the task

I hope I have all the differences between the versions.

The zip only contains the change file + new profiles.
[Android Software Development] brandall:
Thanks - more people will be able to use it then.

Good plan - I assume you've got it switching off at the end of the task though, as Wifi is only triggered to auto-disconnect it is was 'previously connected' NOT just turned on and left... (in case of searching for open networks). Edit - just seen you have done this in the list below.

Ok, I'l investigate further as I think I will build these in as standard - people could always just delete them.

Your thanks meter is +1 and I shall update the first post!
[Android Software Development] bingobadgo:
I am using your profiles above and its working really well for wifi switching but I cant get the mobile data to switch when I am not on wifi. I am using an X10 minipro with Cyanogen Mod6 if it helps. I have just downloaded APNDroid and will try changing your task to use that instead to see if it helps, but do you have any ideas?

Thanks for putting these profiles and tasks up, I was having real trouble getting my head around how to use tasker but you have helped me no end.
[Android Software Development] brandall:
To my knowledge, Tasker should be able to perform this on all devices. Can you do a couple of simple tests for me:

1) Create a new task, #1) set mobile data on, #2) wait 30 seconds, #3) set mobile data off. Please also try this when connected to 2g networks only (menu/settings/wifi & networks/mobile networks/use only 2g networks). Press Test. Let me know if it works correctly.

2) In the above task, add in 'change to 3g preffered' before setting mobile data on. Between the two actions add another wait time of around 20 seconds. Add in switch to 2g only at the end (no wait needed). Press Test. If it fails, try increasing the wait time between 3g on and data connection on.

Let me know the results and we'll go from there.

It's a pleasure.
[Android Software Development] GMH24:
Another user from the galaxy s q&a forum referred me to this thread, although after browsing through it, my question seems a little off-topic :o

Due to some changes by Google, the gps can no longer be controlled via tasker. Is there some kind of workaround or will there be the option again in future tasker releases?
[Android Software Development] brandall:
Hi GMH24,

CM have hacked this and I'm sure other ROM devs will follow suit, although Google will tell you there is actually no need. I can't find the thread to link to, but Google's response to such questions was to always have wifi and GPS ticked in the location & security settings and it will use virtually no (if any) additional resource.

Having the GPS icon highlighted in the Gingerbread status bar power widget is too much for some to bear, but it doesn't actually mean it is on, just available to use at a moments notice.

The above said, your Tasker profiles should no longer need to toggle GPS on/off, if you're running Gingerbread, it will just always be available to use.

Hope that made sense - I have a feeling I'll be copying and pasting this reply to many in the future!
[Android Software Development] GMH24:
Thank you for the reply, however it does not make sense yet! :D

What you're saying is that i should leave gps on (tick checkbox) so that it is highlighted in the pulldonwn menu? And by doing so, the gps is not actually running but ready to use for any application? In essence, gingerbread does what my tasker profiles did?

and yes, you better keep an explanation on your clipboard! ;)

btw: are you the dev of tasker?
[Android Software Development] brandall:
Sort of... in menu,settings,location & security Google say to leave 'Use wireless networks' and 'Use GPS satellites' ticked. By doing so, it is NOT on, or using resource, it will only be immediately available to use by a calling task or application (although some cynics will say it's for location based searches).

The result will be that it may show as 'on' in the pull down menu or in some widgets, but it is actually NOT. It's just ready... Try it, you won't see it activate (start flashing) in the status bar - unless you kick off maps etc. So not really what Tasker did, but now we no longer need Tasker to toggle it - just tell Tasker to 'get location' and you'll see the GPS icon appear...

I'm not the dev of Tasker no, just a big fan of this application and hoping to get more users into it so we can knock up some amazing group profiles such as here
[Android Software Development] GMH24:
Okay, I'll have a try and leave gps on (or in this case ticked, not on :D) during the next few days!

Thanks again for your explanation!
[Android Software Development] brandall:
Pleasure :) You shouldn't even notice.... Let me know!
[Android Software Development] brandall:
V4 Up!

V4

Fixed device-asleep notifications

Adding mobile data controls (equivalent to %WIFIOC and %WIFIORS)

Added WiFi or Data to notifications so you can tell which your device used to sync.

Added days of the week as a context

Hope it's working out for you all - I assume no feedback means everything is working super?!
[Android Software Development] torsrex:
Yep, working perfectly here on leedroid gingerbread Rom!
[Android Software Development] brandall:
Perfection :cool:
[Android Software Development] GMH24:
From what I experienced during the past days, I can confirm that gps does not consume additional juice when left "on" (or rather illuminated :D )

However, here is a problem I am not capable of solving, maybe you have an idea:

with the latest gingerbread updates for the galaxy s, we also got a suspend bug, as well as an android os bug (starts eating like krazy) which result in battery drain! :mad:

The only thing which helps is a reboot...

therefore, we/I would need a tasker profile which could do that - automatic reboot when the phone does not sleep properly during idle and/or android os goes berserk!

OR: an automatic reboot daily at 6am :rolleyes: (unfortunately, I am too much of a tasker noob to figure that out myself :o )

could you help out?
[Android Software Development] torsrex:
Create a new task (any name) with the trigger event-hardware-button long search. Name the task reboot. Tap the + sign, misc, reboot normal. Now, every time you long press the search button, your phone will reboot. You could also add other triggers (e.g time 6:00).
[Android Software Development] brandall:
Exactly as torsrex says. I actually have a 6am reboot task so thought I'd share! It brings up a menu in case you are using your phone at the time and it wont automatically default to reboot if you are on the phone by using the %INCALL variable.

If you are rooted you could try the

Killall system_server

command in a terminal to reboot the OS which is quicker, you can execute it via Tasker if it works - beware though, some devices don't like it - torsrex's phone was fine though!
[Android Software Development] jawz101:
I never really understood your tutorial. I had a short attention span to a lot of your documentation and don't quite understand what these tasks/profiles do.

At first glance it looks like they periodically choose either wifi or mobile data to turn on depending on if you're near a hardcoded wifi SSID or not and then run autosync. If that's the case could you explain them in 100 words or less and delete the rest of the tutorial stuff? :) The only part that needs explanation is where to specify your SSIDS and the best way to do that would be with screenshots.

All criticism aside, I did glean that any power savings plan should assume all data communication protocols off (wifi, mobile data, gps, auto sync).

With this premise I created a task that turns these 4 things off on device boot in case they aren't off already.

I also created an Application triggered Profile that turns on mobile data and auto sync on when the specified applications (email, browser, market, maps, some games, navigator, etc.) are opened- and an exit task which turns mobile data and auto sync back off when those programs exit. The only drawback is there is a delay as the mobile data initializes before the app recognizes it has a connection.

And a 3rd task that runs every hour that turns mobile data and auto sync on for 3 minutes and turns them back off.

For me this gave me roughly the tightest control over my communication and their battery usage. I really don't understand the description of your tasks because they aren't explained in 100 words or less which makes me think they're more complicated than necessary.

I guess I like the way I chose because I never have to toggle connections manually as tasker knows when I use certain applications it will automatically toggle mobile data.

I debated about whether to post something for a couple of days because it's kinda harsh.
[Android Software Development] brandall:
I prefer 'in-depth'!

Tasker is an application that has most beginners scratching their heads at where to start and probably often makes people give up. It is unlikely a beginner could create my profiles, so I write in detail for them, to explain to them my logic in the hope that they will draw on what I've demonstrated and be able to use similar methods in their future, self created tasks - and then share them with me!

Experts can just import the profiles and see what I've done and I assumed intermediates would just pick out the explanations they required...?

What I do seems to be appreciated, in fact you are the first to be negative and as you confess that you haven't fully read it and don't understand it, then yes, your criticism is obviously kinda harsh.

If you do take the time to digest the tutorial, I'm sure you'll see that my profiles are built on the same foundations as yours, only with additional eventualities, not to overcomplicate, just to be thorough; using Tasker to its full potential.

I hope this reply was less than 100 words ;)
[Android Software Development] bingobadgo:
I am running CM6 on an X10 MiniPro and I cant get mobile data to switch on and off reliably. I want it to come on when an app that needs it runs but there is a bit of a lag which causes errors. Any ideas how to a) toggle data reliably, ie are you using APN Droid or the Tasker mobile data toggle, and b) how to get mobile data on reliably before an app such as market or maps or browser runs?

Thanks for all this mate!
[Android Software Development] brandall:
Did you try the above to see if we can narrow down the problem? Sometimes switching between 2g/3g can cause lag... Let me know.
[Android Software Development] torsrex:
Shouldn't the task 5 go to task 8 not 9?
[Android Software Development] bingobadgo:
Hi, I tried the above, step 1 failed to switch my data on so I didnt bother with stage two. I have tried with wait times of 30 sec, 1 min and 2 min and had the same result. I guess it must be something particular to my device.
[Android Software Development] brandall:
In AutoSync I have action #6 'goto' action #10 which is turn auto sync on... different on yours???
[Android Software Development] brandall:
If that basic task doesn't work, then going to have to put it down to your device... Can you toggle your data connection with a widget? If you're rooted, flash another ROM? (Can't see your signature as on XDA app).
[Android Software Development] jawz101:
All things considered I apologize for being rude in your thread. I'll still keep an eye on your Tasker projects and I do admire your eagerness to push the envelope. I have some of the bug but haven't figured out anything too profound or out of the box I could do with it yet that has not already been done.

If anything I was thinking a exercise to coger up some thought would be building some sort of Tasker samples inside of a cascading menu which leverages as many Tasker calls as possible. Still sitting on it, though.
[Android Software Development] brandall:
No apology required, we're all entitled to our opinions, particularly in a discussion forum.

The Tasker wiki is somewhat lacking. There is a direct link to it within the app, but certainly a bolt on containing hundreds of ready-to-go profiles that you can directly download would be good. There are so many users, but not enough sharing...
[Android Software Development] .Ejekt:
I continue to get pop-ups saying my device isn't supported or I'm missing something (forget the exact text, I'll edit next time it happens) Any suggestions?

SGS Fascinate ComRom 1.3

EDIT: "Action Type isn't available for this device"
[Android Software Development] brandall:
There shouldn't be anything your device can't do in these profiles... Can you either post a log in #code# quotes (menu, preferences, misc, debug to SD (make sure you untick this after and delete the file)) or 'test' the tasks individually and see if you can work out which action is it by where the task stops?

We'll figure it out.
[Android Software Development] bingobadgo:
I have now installed apndroid and that seems to work for switching data but it is not turning it on reliably from within Tasker. I will carry on fiddling and post any progress here.

Thanks for the help and keep up the good work!
[Android Software Development] brandall:
On my device I need a wait time after switching between 2g/3g before I turn on the data connection, otherwise sometimes it will just refuse to start. If you don't get it sorted, let me know and I'll forward the log to the dev as there's obviously something a little unreliable going on here somewhere...

Pleasure Bingo, happy to assist.
[Android Software Development] topsign:
Re %WIFIHOME, when connected to a home ap, this var changes to 2

but after autosync process finished, tasker will turn WIFI off if %WIFIORS is 1, then %WIFIHOME is supposed to be 1 or 3 even though I still remain at home.

am I right?
[Android Software Development] brandall:
Hi topsign, yes, pretty much.

%WIFIHOME will be returned to a value of one when you are disconnected from it, regardless of if you are still at home. You can always adjust this if you wish something else to happen.

Only %WIFIOC can go to a value of 3. This is when you have lost connection and it triggers the one minute countdown before checking the value again and switching it off.

Hope that helps.
[Android Software Development] topsign:
thank you brandall for quick reply.

What i need is to make a 'Home profile' by using %WIFIHOME, but it changes after sycning 'regardless of if you are still at home', any advice on how to use this Var to determine my location on other profile?
[Android Software Development] brandall:
It would depend what you want the profile to exactly do... But for a start the event context has a 'variable set' you can use, to trigger when %WIFIHOME = 2. Any good?
[Android Software Development] mi3x:
Ok, so let's say I'm at home on my wifi, what if the phone is screen off for a longer period, does it still remain connected? I'd like to disconnect after a period and reconnect when it's time to sync or my screen is on again.

Or is this what it actually does? Sry, as said, nooooobie here. :D

I'm asking this because I left the phone for 10 min with screen off, no activity, only Wifi File Explorer in b/g, and when I entered the address in my browser it worked, meaning the wifi was still on on the phone.

Another question, when it syncs, it gives me an error (flashes on the screen for 1 sec) about 2G not supported or something like this. I should delete task 20? Or should I put there 3G preferred?

Anyway I LOVE this profile! Thanks again!!!
[Android Software Development] brandall:
Hi mi3x, the idea is to have all data connections off as much as possible, regardless of whether the screen is on or not - This will allow the device to deep-sleep more often and result in battery savings.

There is a variable %WIFIORS (wifi original state) that is checked at the end of the autosync task. If wifi was on when the sync started, it is assumed that you are currently using it for browsing or email etc and therefore Tasker will not turn wifi off IF %WIFIORS = 2. The same goes for %MOBDORS = 2. It's assumed you were using the connection.

So, to test this is working for you correctly, ensure your data and wifi is switched off. Press 'test' in the autosync task and see in the notification bar that it is turned on and turned off when it has finished. Do the same with data only on before it starts (it should leave it on at the end) and again with wifi.

You can remove the data 2g/3g if you want - is your device CMDA? APNDroid may be an alternative if it is.

Let me know if it isn't working as it should for you.
[Android Software Development] mrsmith35sg:
Brandall, not to hi-jack but I've followed this thread since you first posted it and seem to have a good understanding of how Tasker works.

If I'm not as much concerned with auto-syncing, is there a theoretical way to create a profile where my 3g/wifi is always off unless i physically open an app?

I first followed this because of my g/f's battery complaints and her sync wishes, but I'd rather be able to check things as I please rather than vice versa and was wondering if you had any insight. Thanks
[Android Software Development] brandall:
Hi mrsmith35sg, yes it's possible, but a little messy due to the applications you request to start often flashing up a 'no active connection' error. Regardless, I'll give you the basics.

Context - Application (select Browser for example)

New Task

#1 Kill App (browser)

#2 Turn on data/wifi connection (you can use such variables as %WIFIOC if you'd prefer to check WiFi had successfully connected prior to turning on mobile data)

#3 Wait (for however long it normally takes your device to get a data connection)

#4 Load App - (Load Browser)

Add Exit Task (If you want)

#1 Turn off data connections

Unfortunately the exit task triggers whenever the chosen application is no longer in the foreground (%LAPP). So the minute you press your home button, or flick to another app, however briefly, it'll kill the connection...

Hope that gives you a start to build from!
[Android Software Development] mrsmith35sg:
Thanks a ton, extremely helpful info
[Android Software Development] raiderkilo:
Hi

Your profiles is perfect & useful.

Two question:

First - Is possible to ad WIFI/Data on-off when screen is on-off.Or how to implement to Your profiles.

Second - How to ad two Auto-Sync profiles one for week and other for weekend.

THX
[Android Software Development] brandall:
Hi raiderkilo, glad they're working for you.

1) Yes, it's possible, but would have to be two separate profiles:

Event - Display Off

New Task

Variable set %WIFISCR to 1

Wait 5 seconds

Mobile data off IF %WIFISCR = 1

WiFI off IF %WIFISCR = 1

Stop

Event - Display On

New Task

Variable set %WIFISCR to 2

** Whatever other conditions you'd like to add here**

Wifi on

Mobile data on

Stop

The 'wait' action stops wifi and mobile data from switching off if your screen switches off for just a moment. If you add these profiles, mobile data and wifi will switch on EVERY TIME you turn on your screen. To stop this happening you need to add lots of other conditions/actions depending on when you want this to occur... Otherwise you'll drain the battery!

2) At the moment you'll have to set up another profile exactly like AutoSync:

New, 'Time' (set this to repeat once every 4 hours of whatever you would like at the weekend).

Task - Autosync

'Done'

Click on the new profile and click 'Add'

Select 'Day' - choose Saturday and Sunday.

Make sure your other weekday profile doesn't overlap!

Hope that helps. Good luck!
[Android Software Development] raiderkilo:
Thank You for help,works like a charm :)

Long time have I use Juice Deffender for battery saving,but long term I am not satisfied.

Before I use Tasker only for simple things like Night Profile,Meeting,Keyguard & atc.
[Android Software Development] brandall:
Great, hope you can get some more ideas from my annoying signature :eek:
[Android Software Development] raiderkilo:
One idea to Display On,how to ad after unlock in stock android or after unlock with Widget Locker(for user with Widget Locker installed).Simply add the task "unlock" or make a profile Unlock?

THX

To ideas from Your Signatures I wonder the CPU Control & Sherlock.In future possible Alarm,but present time I'm satisfied with Gentle Alarms.
[Android Software Development] brandall:
I think Widget Locker has a plugin for Tasker? I'm not sure... If your device is set to lock straight away, then yes, you could replace the display on/off profiles with 'unlock'/'lock' instead. You'd have to experiment!

That's the good thing about Tasker, you can make every app/profile exactly how you want it... :)

The CPU profiles are pretty straight forward and they use display on/off contexts, so ideal to combine with what you are doing!
[Android Software Development] raiderkilo:
For AFTER UNLOCK I change Event - Display On to Event - Display Unlock and ad task about Battery level 25%
[Android Software Development] brandall:
Good work. How are you dealing with having the wifi turn on when you are not around a preferred SSID? Is it just staying on??
[Android Software Development] raiderkilo:
Thats next step.
[Android Software Development] brandall:
In the displayon/unlock profile you have that switches the WiFi on, you could try variable setting %WIFIOC to 3 in action #1.

That would trigger WIFI-AutoDiscon every time and turn it off if it wasn't connected to a preferred SSID within a minute?

I think....?! :eek:
[Android Software Development] raiderkilo:
I try This,give info

THX
[Android Software Development] raiderkilo:
With variable %WIFIOC works better.

I Think :)
[Android Software Development] brandall:
Ha! I hope so... :)