Android Tasker: Setting time limits for Angry Birds and other timesucks

angry-birds

Angry Birds is our new household obsession. J- plays it on her iPod Touch. W- plays it on his Nokia N8. Me, I caved in and installed it on my Android phone. It’s a physics-based puzzle game with amusingly Rube Goldberg-ish levels. I tell myself that playing contributes to social bonds with W- and J-.

image

The game is set up as a long series of puzzles much like the screen above. When you finish a puzzle by destroying all the green pigs, you see one to three stars depending on your score, and you can either replay the level or move on to the next one.

Angry Birds is easy to learn and very engaging. I’m often tempted to check out the next puzzle even when I really should be going to bed. I tried using Tea Timer to give myself five-minute limits, but that took too many taps to set up.

Solution: Use Tasker to automatically set up a five-minute time limit for Angry Birds. That way, the timing is built in. I created a quick task that started whenever I launched Angry Birds, waited five minutes, and then returned me to the home screen. It’s enough to snap me out of the timesuck haze and remind me what I should be doing.

Here’s how:

  1. In Tasker, click on New and set up a profile. For the context, choose Application. Choose the application(s) you want to limit, such as Angry Birds. Click on Done.
  2. Click on New Task. You will be prompted for the task name. You can give the task a name if you want, or leave it anonymous. Click OK.
  3. Click on the + sign to add a new action. Choose Tasker > Wait and set it to the duration you want. Click on Done.
  4. Click on the + sign to add another action. Choose App > Go Home. This should keep the applications running, but return you to the home screen so that you can decide what to do next.

Instead of returning to the home screen, you might want to have Tasker bring up your task list, your calendar, or a note from your saner and more productive self.

image

I really like Tasker. =) It takes some getting used to, but it’s powerful. It’s like being able to defadvice Android applications. defadvice is an Emacs-ism that lets you specify code that runs before, after, or around other code, and it’s one of the reasons why Emacs is amazingly programmable. In addition to context-sensitive settings (like the way I automatically turn WiFi when I leave the house), Tasker lets me specify actions and settings that are active before, after, or around other things on my Android. I wish my apps exposed more functionality to Tasker.

Here’s the XML version, if you want to import it. tasker_angry_birds.prf.xml

<class cl="TaskerData" sr="">
  <class cl="Task" sr="task21">
    <id>21</id>
    <class cl="Action" sr="act1">
      <class cl="IntArg" sr="arg0">
      </class>
      <code>25</code>
    </class>
    <class cl="Action" sr="act0">
      <class cl="IntArg" sr="arg4">
      </class>
      <class cl="IntArg" sr="arg3">
      </class>
      <class cl="IntArg" sr="arg2">
        <val>5</val>
      </class>
      <class cl="IntArg" sr="arg1">
      </class>
      <class cl="IntArg" sr="arg0">
      </class>
      <code>30</code>
    </class>
  </class>
  <class cl="Profile" sr="prof15">
    <nme>Angry birds</nme>
    <id>9999</id>
    <class cl="AppContext" sr="con0" ve="2">
      <label0>Angry Birds</label0>
      <cls0>com.rovio.ka3d.App</cls0>
      <pkg0>com.rovio.angrybirds</pkg0>
    </class>
    <mid0>21</mid0>
  </class>
  <tv>1.0.13m</tv>
</class>
  • http://www.curiousmitch.com Mitch Cohen

    Tasker is a great app, I use it for a number of time/battery saving things on my Droid X, as for angry birds, I went with the low tech solution, I simply never downloaded it.

    Great example of using Tasker though!

  • http://sachachua.com Sacha Chua

    Mitch: Heh, smart move.

    I do actually like checking out something W- and J- both enjoy, and I don’t mind converting some of my subway podcast-listening or book-reading time to game time. In this case, having the temptation of a game on my Android is fine. =) Best to avoid it, though!

  • http://gwenhael.net Gwenhael

    There’s a typo in the third step, it should be Task>Wait

    I bought Tasker yesterday but I must say trying to use it is a bit painful, I wish there was a way to just type code…