Sunday 18 December 2011

Logical Slimmer Llamas

The new beta version of Llama now supports ORs of conditions. Normally, an event will only fire if all of its conditions are true, but there are some times when you'd want only some of those conditions to cause the event to fire. Previously, you could solve this by having multiple similar events, but that quickly gets messy (especially with Llama's crappy UI ;). The OR operator is implemented in Llama as a special condition that takes a list of other conditions and only requires one of them to cause the event to fire. At the same time, I've also added an AND condition. You probably won't use this much, as the default behaviour of an event is an AND, but if you need to use an AND inside an OR this is how you achieve it. Most people aren't familiar with ORs and ANDs (at least in the Boolean sense), so Llama also refers to them as 'match all' and 'match any' respectively. You can read through the previous paragraph and replace 'OR' with 'match any' if you like.

To create an event that vibrates whenever you plug in the headset or charger, you would need to create an event like this:

OR (Match any) (Headset connected, charging) -> Vibrate

If you have event colouring enabled in Llama's settings, you'll also be able to see the current status of the ORs and ANDs. Each OR and AND will have a set of square or curly brackets that show which conditions it contains, and also the state of those conditions. If any of an OR's conditions are true, then the brackets will be green, otherwise they'll be red. Similarly, if all of and AND's conditions are true, it's curly brackets will be green, otherwise red.

Another noticeable change is the naming of builds. Android lets apps have two version numbers:

  • a version code (usually just incremented from 1)
  • a version name (whatever you want, I use the compile date)

Previously, I used the version code to name the beta builds that I upload to mediafire. Since I introduced in-app billing I now need to keep the version code in-sync with the version on the market. The market uses the version code to determine whether a version of an app supports billing or not, otherwise it'll say:

'Application Error: This version of the application is not configured for Market Billing. Check the help center for more information.'

From now on, the version code won't increment until I plan to release a market version, so that the betas can still use in-app billing. Finally, I've got around to using ANT builds rather than hitting the Export signed APK button in eclipse. Llama is also getting fat and overweight with all of the languages that it has, so I've set up a tool that'll build 4 versions of Llama:

  • The usual market-style Llama you all know and love, with all the languages and no CALL_PHONE permission.
  • A version with all languages and CALL_PHONE permission, so that you can dial call-forwarding codes.
  • A thinner version of Llama with only en-gb resources, and no CALL_PHONE.
  • A thinner version of Llama with only en-gb resources, and CALL_PHONE permission.

You can find these versions in the Kebabapps Llama page on mediafire. I won't always remember to link to them.

Assuming all goes well, this version will be released to the market next week, maybe in time for Christmas, or maybe after if I'm not doing anything exciting for Boxing Day. You can also assume that me reading reddit will play some part in delaying the release :)

Version 1.2011.12.18.2207

  • OR/AND - Match any/all conditions
  • An alternative colour-blind setting for the coloured event list
  • Event list now colours events on a separate thread, so switching tabs responds faster
  • Events run through shortcuts now appear in event history
  • Fixed a forgetful Llama problem when using LlamaMap in low-memory situations
  • Now uses big red button for doing builds

[Insert the usual disclaimer about exporting Llama's data before installing test versions]

Download