AccessoriesAndroid

How to create dynamic Sony Smartwatch widgets using Zoom and AppWidgetDisplay

ssm dynamic widget - for some reason we don't have an alt tag here

Note to anyone finding this while searching for Sony Smartwatch information: This article refers to a lot of Tasker features that you need to understand in order to understand this post. If you’re new to Tasker, you can check out our beginner’s guide and other Tasker articles

Back in my main post on using the Sony Smartwatch with Tasker, I mentioned how some widget creation apps I’d tried ended up crashing their parent app when used with AppWidgetDisplay, a Sony Smartwatch plug-in that allows you to put normal widgets on your watch. One of those apps were Zoom, the widget creation app made by the Tasker developer. It crashed after I ran through the calibration routine, and as such, I uninstalled it.

Since Zoom is so much more integrated with Tasker than anything else though, I decided to give it another go, and see if I could find a calibration configuration that would let it work. After a bit of trial and error (and no crashes), I managed to get it configured to where it works fairly well. It doesn’t fill out to the edges on the left and right side, but does do so on the top and bottom, meaning that it essentially displays tall widgets in the middle of the screen. This isn’t ideal, but it works, and Zoom’s other features make up for it not filling the entire screen. To get to this configuration, you basically just have to add the calibration widget, calibrate it, delete it, add a widget with a solid color all over it, see how much it fills out, then repeat until you’ve found the sweet spot.

Once you have set it up though, you have a ton of tools at your disposal. Zoom integration is its own category of Tasker actions, and you can manipulate elements much like how you manipulate scene elements. There are actions for setting the visibility, text, image, and so on of the elements added to a Zoom widget, which means that you can create dynamic widgets by manipulating these intelligently.

As an example, my first creation with this is a dynamic phone mode activation widget. Before I created a dynamic widget, I had two icons that manipulated the phone mode: one for nap mode, and one for school mode. Nap mode is an old creation of mine, and having an activation icon for it on my watch basically means that if I’m tired, sick, or have any other reason to go lie down for a bit, a single tap on my watch sets the phone to silent mode, turns off the lights, and shuts off my PC monitors. The other mode is one I use both for lectures I attend and for when I’m teaching.

The thing is that I never take a nap if I’m not home, and I’m never home if I’m at school (duh). This means that when I’m at home, the school mode widget is useless, and when I’m not, the nap mode is. Since you have to scroll through the widgets you have in AppWidgetDisplay, the less you have the easier it becomes, so I decided to switch out my two existing widgets for a single dynamic one. When I’m at home, the widget shows a nap mode icon, and clicking it toggles nap mode. When I’m outside, it shows a school mode icon, and clicking it enables school mode. When school mode is then active, it displays the same icon, but clicking it then disables school mode. One widget, two icons, three on-click tasks.

ssm zoom 1 - for some reason we don't have an alt tag here

Doing this is very simple, and it’s essentially just the same as creating a toggleable task in Tasker (meaning you should read up on that before continuing). You can expand this with whatever widget elements you want, but my widget only contained a single image, which I never configured an actual static image for. All I did was add the image element, link the on-click action to a task in Tasker, and then save out of Zoom.

With that set up, the rest happens in Tasker. Since I already have tasks running for the activation of these three different modes, I simply added a Zoom Element Image action to those tasks, and configured the image I wanted the widget to display while that profile is active. When the task runs, the widget is then set to that specific image. I did the same for the two other modes as well, Outside and School.

As for the task tied to the on-click action for the widget image element, it’s a nested If/Then tree with three different options. If the Home profile is active (I have a variable to check that), it runs actions that toggle nap mode. If the School profile is active, it disables it. If neither are active, which is the same as saying the Outside profile is, it activates School mode.

ssm zoom 2 - for some reason we don't have an alt tag here

I’m able to do it like this because I already have established variables that I can tap into for If/Then control. If you’re starting “from scratch” however, you can make the widget task toggle itself, using the method in the toggleable task post. It basically involves several If/Then groups where the actions of one also makes sure the next one is activated in its place the next time the task is run.

Another potential solution would be to have multiple widget element overlapping, each tied to a single task, and simply manipulate their visibility to decide which one is active. This makes for less complicated Tasker tasks, but more complicated Zoom widgets.

No matter what solution you choose though, you can expand this much further than what I’ve done. You can even make rudimentary “apps” that you can navigate this way, by adding widget elements that trigger a series of actions to change the widget. Another advantage of this is that you can use images very dynamically, which means that you could in theory create something that displays for instance album art, security camera photos, or weather icons as part of the widget.

For the time being I only have this mode toggle widget that uses this, but I’m contemplating other ways I could use it personally. It’s great to be able to make practically anything you need on a device like the Sony Smartwatch, so that coming up with clever ideas is the problem, not finding solutions to clever ideas.

tasker banner - for some reason we don't have an alt tag here

Pocketables does not accept targeted advertising, phony guest posts, paid reviews, etc. Help us keep this way with support on Patreon!
Become a patron at Patreon!

Andreas Ødegård

Andreas Ødegård is more interested in aftermarket (and user created) software and hardware than chasing the latest gadgets. His day job as a teacher keeps him interested in education tech and takes up most of his time.

Avatar of Andreas Ødegård