Saturday, 3 December 2011

App start/stop condition and donations

Following on from the event-testing speed up two blog posts ago, Llama can now monitor the currently active application. You can now do interesting stuff like turning Wifi on when you open the browser, or adjusting the volume when you open a music app. Every time that you switch app, Llama will need to check if your events should fire. That's why the performance improvement was needed first, and why I've been putting it off until now :)

If you don't include an Active application condition, Llama won't waste time checking the active app. However, if you do use it, Llama will need to poll the ActivityManager for the current application. It's a shame that Android doesn't let an app receive a prod when the app changes. You can change the polling time in Llama's settings; the smaller the value, the quicker Llama will be able to respond, but it'll take more CPU time. If you set it to a high value, say 1 second, you should be fine. One second is probably good enough for most people, given that the start application animation takes about a second.

I've also implemented in-app purchases for donations. Plenty of people have wanted to donate more than 80p, so you are no longer limited to the one-off 80p Llama Donation that's in the Market. If you donate from within the app, you can finally uninstall the Llama - Donation app if you wish. The in-app purchases act as a separate marker that Llama checks to see if you've donated. (Not that there's much of a difference after donating... you just won't see the donate message ever again.)

You can donate as many times as you want, so you can add up the donations to your target value.

I've only tested this on my English, Great-Britain based phone, which shows the currency and prices in GBP. I'd be interested to hear if any you have problems looking at the donations page using a phone from a different country. Ideally, it'll show your country's currency if the Market supports it, otherwise fall-back to GBP.

Version 1.2011.12.03.2130

  • Active application start and stop condition
  • In-app donations
  • App notification icon condition now has an app-picker
  • Updated Polish and Slovenian translations, cheers guys :)

As usual, export your data before installing test versions, just in case you have to go back to the market version.