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

Question about creating widgets with Tasker

MaxPower1

Newbie
Jan 3, 2011
29
2
Simple question, can I create widgets with Tasker to change settings? For example, say I create a widget called "Work", when I press that widget I want it to lower the volumes (ring and notification), disable vibrate (very important), turn off WiFi and haptic feedback. Then I want a widget called "Car" when I press it it will turn the screen brightness all the way up, turn on GPS, launch Waze, etc. Is this possible? My extensive Google search didn't give me a straight answer.
 
All tasker tasks are already widgets. Long press home screen > widgets > task

You may want to assign an icon though. In a task (via tasker) when editing, press the colour chart / swatch icon in the bottom right corner to choose.

You need to be clear what you want it to do. Instead of a context triggered task that will turn something on or off then revert as an exit task etc, you will most likely want to use toggle so the same widget turns on and off.

For example, audio task, you can set to turn audio on, off or toggle.

If you want it to toggle between 2 different volumes however, well this would be more tricky.

What you could do there is have the toggle change a variable and then have profiles triggered by the variable

tasker.wikidot.com/togglewidget
 
  • Like
Reactions: D-U-R-X
Upvote 0
Alright, I bought Tasker and started setting up profiles, so far everything is working like I need it to. I did run into problems with the phone vibrating when I got SMSs in a certain profile, I didn't want this to happen and couldn't figure out how to get it to work in Llama. It turned out to be Handcent overwriting the settings. I uninstalled that and installed GO SMS and now the phone doesn't vibrate when I get an SMS while the "Work" profile is enabled. (Vibrate can be too loud, especially when the phone's sitting on a hard surface)

I do plan on having several profiles set up so toggling them on and off shouldn't be necessary.
 
Upvote 0
With native Tasker, I think you're limited to 1x1 widgets. For something more intricate, you can use Zoom.

Zoom was written by the same guy who developed Tasker. As such, it integrates thoroughly and easily with Tasker: you can run tasks by interacting with widget elements; tasks can modify the appearance and state of widget elements; widgets can monitor variable states and update themselves accordingly. It's pretty intuitive, and not difficult to use, once you get the hang of it.

I used Zoom to create this widget:

View attachment 50964

The buttons all call the same Tasker task when clicked, but each sends a unique parameter, corresponding to Loud, Normal, Quiet or Silent sound profiles. After the task sets the volume levels, it updates the widget speaker icon to reflect the new value, and updates the levels shown in the widget's static text area.

This widget was trivial to implement. By far, the most time consuming piece of it was to draw the speaker and buttons. (BTW, the buttons can be real buttons, rather than crude images, like I have them. In fact, I first implemented the widget with actual buttons, but I wanted to try out the hand drawn images. I liked the rustic look of the images, so I left them. :D)

As another example, I have a profile that monitors the time of day, to adjust both the sound profile and screen brightness at bedtime, and restores the settings in the morning. Sometimes however, I stay up later than normal. For this reason, I wanted a quick and easy way of overriding the profile behavior.

So, I created this widget:

View attachment 50965

This is very similar to the Silent Toggle widget on the Tasker wiki. When pressed, it simply toggles the value of a certain Tasker variable. I then added an additional state to the profile, requiring the variable to be in its "off" state, in addition to the time-of-day requirement. Finally, I modified my "Set Sound Profile" task to update the widget to the correct override state:

View attachment 50966

(BTW, to create the icons for this widget, I used an app from a different developer called Simple Text-Text Icon Creator)

Definitely check out Zoom if you want to create anything more than a 1x1 widget. It's a great add-on to Tasker that adds tremendously to its usefulness.
 
Upvote 0

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones