Sunday, 21 August 2011

Confirmable, delayed, repeating events

I've been working away on a few new features for Llama's events.

Confirmable event

The event's actions won't fire until you select the notification or press 'Run' on a dialog that pops up. This could be useful if you have an event that starts the music player when you plug your headphones in. Sometimes you may not want the music to start immediately, so this puts you in control.

Delayed events

Since Llama is using phone masts to determine your location, you aren't usually inside your house when Llama first sees the phone mast that covers you house. You can now make events wait a while before running their actions.

Repeating events

One of the more common requests is for repeating events. Most people seem to want to turn mobile data on and off periodically. Repeated events start repeating after they are triggered and continue repeating until the event's conditions are no longer true. e.g. for an event that repeats every 5 minutes, if you enter your home at 12:03, the actions will run then at 12:03, 12:08, 12:13, etc. However, if your event was defined as 'At home, between 12:00 and 12:30', and you were already at home at 12:00, then the events would run at 12:00, 12:05, 12:10, ..., 12:25. The last time is exclusive, so it won't run at 12:30.
You can combine each of these into one event. The order that they work in is: delayed, confirmation, repeat. That is to say that if an event requires confirmation, the confirmation dialog won't appear until after the delay has occurred. If an event is repeating, the repeated actions aren't run until after the delay has passed or the confirmation has been granted
As an example, you can create events like this:
Between 7am and 11pm -> Set mobile data on every 15 minutes
Between 7am and 11pm -> Delayed by 1 minute, set mobile data off every 15 minutes


Wifi network connected -> Enable Sync every 15 minutes
Wifi network connected -> Delay by 1 minute, disable Sync every 15 minutes

It's still a bit clunky... e.g. if you disconnect from a wifi network shortly after sync was enabled, then the disable event won't be able to fire a minute later because you were no longer connected to a wifi network. You could fix that with another event 'Wifi network disconnected -> disable sync'. In the future, I'd like to have a 'queue event' action, that will let an event queue another one-off event.
This is very much a test version. As always, you should export your settings and make a copy of them somewhere (maybe email yourself a copy). This version stores more information about events that older version will not understand, so if you have to rollback to the market version you'll have to use your backed-up settings.
There's a few other changes in this version, but it's late now and I can't be bothered to write about them right now... expect another blog post soon :)

Also, is it just me or does every WYSIWYG editor for blogs and CMSes suck? I hate them with a passion!!! I'll fix the crappy formatting in the morning.