• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Tasker Question: How to make widget?

gilbequick

Well-Known Member
What I want to do is create a widget that when pressed will turn Wifi on and Data off, and when pressed again will turn Wifi off and Data on. So really a widget that will toggle between the 2. I've been messing with it for a while now but the more I do the more lost I get.

Step by step instructions would be greatly, GREATLY appreciated.
Thanks!
 
You only need a widget that controls Wifi. By default, if you aren't connected to wifi, you'll connect to data.

And you don't really need a widget. Your status bar has this control built-in (I assume, as I have that on my Captivate...maybe it doesn't exist on the Droid).

Single controls can be done in Tasker, but kind of a waste of it's power.

Better things to do with Tasker is to control at least two parameters, for example, I get really annoyed when my phone auto-rotates in most apps, but when I surf, I like auto-rotating for easier reading...So I've got a profile that turns auto-rotate ON when I'm surfing, but when I exit, auto-rotates is OFF.
 
You only need a widget that controls Wifi. By default, if you aren't connected to wifi, you'll connect to data.

Thanks for the reply. A wifi widget unfortunately won't do it. Let's say I have a wifi widget: when the data is turned on and I hit the wifi widget, it will turn off the data and turn on the wifi, but when pressed again it will only turn off the wifi and not turn back on the data.
A separate widget for wifi and data would work, but I only want one widget to do the job. Screen space is limited.

And you don't really need a widget. Your status bar has this control built-in (I assume, as I have that on my Captivate...maybe it doesn't exist on the Droid).

My status bar doesn't have this, I think it's a Samsung thing. My old Intercept had it and my wife's Moment has it, and also your Captivate, but not my LG Optimus. Even if it did, I still want a widget to toggle between the 2!
 
Are you absolutely sure that turning off Wifi on your phone doesn't automatically turn on data? Is that an LG-specific thing?

On all the phones I've had thus far, if wifi is off, mobile data resumes.

Sometimes it takes a few seconds for the data icons to show back up in the status bar after disabling wifi.
 
Are you absolutely sure that turning off Wifi on your phone doesn't automatically turn on data? Is that an LG-specific thing?

On all the phones I've had thus far, if wifi is off, mobile data resumes.

Sometimes it takes a few seconds for the data icons to show back up in the status bar after disabling wifi.

I just played around with it for a few minutes. Turning WiFi off does not turn the Data on. Also, when turning the Data off does not turn the WiFi on.
 
Sounds as if you have two separate controls? You actually have a button/control that turns data on/off? That is interesting as that does not exist on AT&T phones (gee, I wonder why?! answer: $$$$)

If that is the case, then it makes sense what you want from Tasker.

You have to create TWO tasks in tasker. One for Data On/Wifi Off and one for Wifi On/Data off. Then create a menu that includes these two tasks. Then create the widget from the menu that you created.
 
I wish I was proficient enough with Tasker to do that on my own! I can follow directions like a champ, but am not good enough with Tasker to do it on my own yet.

Anyone care to help a Tasker Newbie out?
 
What have you done so far? I'll help you, but I firmly believe in teaching someone how to fish rather than giving him a fish :)

Would recommend reading/skimming some of this: Step-Throughs & How-Tos - Tasker Wiki

Then take a stab at doing it. What you want to do is pretty easy. You just need to have a basic understanding of Tasker.
 
Here's an easy way to make a toggle widget.

Profile: Widget
Context: Variable Value (%WIDGET = 1)
Task: Wifi On, Data Off, Flash "Wifi On"
Exit Task: Wifi Off, Data On, Flash "Wifi Off"

Save this.

Then long press on the home screen. Add a Task widget.

For the widget task, do the following:

Variable Add
Name: %WIDGET
Value: 1
Wrap Around: 2

This widget will toggle the value of WIDGET between 0 and 1 each time you press it. (The wrap around of 2 means that when the value reaches 2 it goes back to 0.)

So, press the widget. +1 gives you a value of 1. Profile turns on.

Press the widget again. +1 gives a value of 2 (which goes back to 0 with the wrap around) and the profile turns off.


Edit: The added benefit of making your widgets this way, is that you can create other profiles that change the variable value in different situations as well to (essentially) automatically "press" the widget in a certain location/at a given time/etc.
 
Here's an easy way to make a toggle widget.

Profile: Widget
Context: Variable Value (%WIDGET = 1)
Task: Wifi On, Data Off, Flash "Wifi On"
Exit Task: Wifi Off, Data On, Flash "Wifi Off"

Save this.

Then long press on the home screen. Add a Task widget.

For the widget task, do the following:

Variable Add
Name: %WIDGET
Value: 1
Wrap Around: 2

This widget will toggle the value of WIDGET between 0 and 1 each time you press it. (The wrap around of 2 means that when the value reaches 2 it goes back to 0.)

So, press the widget. +1 gives you a value of 1. Profile turns on.

Press the widget again. +1 gives a value of 2 (which goes back to 0 with the wrap around) and the profile turns off.


Edit: The added benefit of making your widgets this way, is that you can create other profiles that change the variable value in different situations as well to (essentially) automatically "press" the widget in a certain location/at a given time/etc.
I think this is the thing for me, but the profile setup won't allow for an exit task. Any ideas?
Edit: had wrong variable context, figured it out, thanks a bunch.
BUT I am wondering if you know of a widget task to set to cycle between 2 icons for each profile? I tried a few combos, but couldn't get the widget to use my cust icons.
 
**********
So, press the widget. +1 gives you a value of 1. Profile turns on.

Press the widget again. +1 gives a value of 2 (which goes back to 0 with the wrap around) and the profile turns off.
**********


Could this be modified to include "off"? E.g., toggle 3G > wifi > off?
I've played a bit with Tasker with only moderate results ...
 
Back
Top Bottom