Monday, 30 May 2011

Plugins be gone

So a quick follow up to the last post. When Llama updates Minimalistic Text Widget, it does so by sending a broadcast named com.twofortyfouram.locale.intent.action.FIRE_SETTING. This is what Minimalistic Text Widget looks for when it watches for updates. This broadcast also contains two pieces of information de.devmil.minimaltext.locale.extras.VAR_NAME and de.devmil.minimaltext.locale.extras.VAR_TEXT, which contains either llamaprofile, llamaareas, the names of areas or the name of the current profile.
A downside to this approach is that every plugin/app that wants to receive the FIRE_SETTING broadcast will receive it. It's then up to the plugin to decide what to do with the broadcast. A good plugin would check to see if the contents of the broadcast were not relevant and then ignore it. As it turns out, there are some plugins/apps that will perform an action upon receiving the broadcast, even if the broadcast wasn't meant for them. See edits below.

So for now, Minimalistic Text Widget support has been turned off. I can't act as the middle-man between someone that has a broken plugin and the developer of that plugin. Instead, I've kindly asked the Minimalistic Text Widget dev to support his own broadcast name. That way anything destined for Minimalistic Text Widget won't get sent to any other apps. Also, other new apps won't have to worry about weird stuff happening when they update Minimalistic Text Widget.
Many thanks to the Minimalistic Text Widget dev for his help!

EDIT: Looks like a really easy fix is to set the package and class name of the broadcast to the package and class name of Minimalistic Text Widget's broadcast receiver. But that's a job for another day. Now is sleep time :)

EDIT: This post was written during the initial-rage of unhelpful comments appearing on the market. After looking over the documentation of a Locale plugin, Llama shouldn't have been sending a broadcast to everything that watches for com.twofortyfouram.locale.intent.action.FIRE_SETTING. I've updated the Minimalistic Text Widget wiki accordingly, so now only Minimalistic Text Widget is targeted by the broadcast. Look at the latest blog posts for a test version.


I've had a lot of whinging about Llama doing weird stuff like turning off Wifi, running something called RadarDroid. I think it may be related to the updates that I'm sending to Minimalistic Text Widget, so I've removed support for it for the moment.

Sunday, 29 May 2011

Another month, another version

There's another new version on the Market today with some more lovely features.
Llama now sends a broadcast when it switches sound profile, so that other apps (such as Volume Locker) don't try to set it back to normal. Llama now also has it's own feature to reset the profile immediately if you accidentally change the volume. Previously, you would have had to have the 'lock profiles on volume change' tickbox ticked and the interval set to 1 minute.
One of the problems with developing Android stuff is the number of different devices out there. I'd say the biggest issue is different screen sizes. Sure there's an emulator that lets you check, but it's slow and horrible. It may be fine if you have a whole team of people working on an app and a dedicated QA team, but I'm just one bloke killing some time. If anyone wants to donate a HTC Wildfire or Xperia X10 mini that'd be awesome :D Anyways, I've made the larger dialogs (such as the calendar event condition and vibrate action) scrollable. It's the easiest solution that seems to work, rather than redoing the dialogs.
One of you guys suggested probably my favourite improvement: colour the conditions in the event list, so that you can see which ones are true and false. You can turn this on in the settings, as I'm guessing some of you will 'OMFG, its ugly' the comments if you couldn't turn it off :P
Red means an event condition is not currently true, and green means a condition is currently true. A green underlined condition means that condition triggered an event last time that Llama was triggered to check the events. It's possible to have an event who's conditions are all green, but the event actions (e.g. Wifi on) don't match up with the current state. That's probably because you've got another event that changes the action, but with another set of conditions. e.g:
  • Enter Work, Between 9am and 5pm -> Wifi On
  • Charging -> Wifi Off
If you were at work after 9am, both Enter Work and Between 9am and 5pm would be green and Wifi would be turned on. If you then connected your charger, Enter Work and Between 9am and 5pm would still be green, but Wifi will have been turned off. To fix this, you should do something like:
  • Enter Work, Between 9am and 5pm -> Wifi On
  • Charging, Not at work -> Wifi Off
That way, the Wifi Off action will never occur when you are at work. Also, you may never see the underlined green conditions. It is only underlined if the trigger matched the condition last time that Llama checked; it's possible that Llama checked events for another reason shortly after. e.g. in the example above, Llama may have received an 'Enter area' trigger, so Enter Work would be underlined. Shortly afterwards, you may have unplugged your headphones causing Llama to check for any events with a 'headset disconnected' trigger.
There's also some inital support for the Minimalistic Text Widget. Use the custom layout with a 'Locale variable'. The two that Llama current supports are:
  • llamaareas - Shows all of the current areas, comma separated
  • llamaprofile - Shows the current profile
I'm guessing you'll want more. e.g. Only 1 area, so that the widget doesn't get flooded with text, or maybe one that says 'Profiles locked'. Thoughts? Suggestions via email please.
There's now a wifi connected/disconnected condition so that you can specify when you're at home or work without any polling. Bear in mind your Wifi settings may turn off Wifi when the screen is off. Change this by going to the Wifi settings and pressing Menu, then advanced, then Wifi sleep policy.
There's also a media button action, so you can send play/pause/next/previous. Unfortunately, Android version before Honeycomb only support a combined play/pause action, so if you choose to use such events, you'll need to guard against any accidental pausing by using a 'music paused' condition in your events.
And finally, there's a USB storage action. So you can automatically turn on USB mass storage when connected to USB. You can also create a Llama shortcut that will toggle USB mass storage on and off... no more having to pull down that bloody notification bar, then tapping the notification, then pressing the button. Who came up with that sh**?! I know there's widgets out there that do something similar, but there's no denying it, widgets slow down home-screens while they load.
Also, I'm fairly bad at posting the changelogs anywhere but the market, and the old ones disappear when a new version is posted. So here's the last two:
-Works with Volume Locker
-Option to reset profile on accidental change
-Screen on/off condition
-Different notification/ringtone volume bugfix for some phones and option to never retick the 'use incoming call volume for notifications' box
-Minimalistic text widget support (see blog)
-Some dialogs now scroll for small screen devices
-Event list condition colouring option
-Usb storage action
-Media button (play/pause/etc) action
-Wifi connected/disconnected

-Russian, Croatian and Italian translations. Cheers guys :)
-Turn screen on action
-Background errors/warnings can now be shown as notifications rather than toasts. Can also hidden
-Experimental cell polling tweaks
-Experimental WiFi polling tweaks
-Day of the Week condition behaves between 00:00 and 00:01
-Calendar read errors now shown as errors (turn off Notification Errors if you get a lot of these)
-Fixed some crashes
-Fixed some freezes