Quantified Self with Android Tasker and Google Forms

I've been interested in quantifying various activities I do and behaviours I have for a little while now, especially after hearing about the Quantified Self and guys like Nicholas Felton and his Annual Reports. I think the saying ‘you can't manage what you can't measure’ holds a lot of value, and knowing in quantifiable terms what aspects of your life are having a positive or negative affect on your happiness (or productivity or whatever) can be powerful thing.

I wanted to setup a simple way to keep track of a few things as easily as with a click of a button on my phone. I know there are applications out there like Daytum, but I don't want to have to type every time I want to add an item (plus Daytum doesn't have an Android application). So I got to thinking and came up with a basic way of keeping tracking of single instance items using Google Forms and the Tasker Android application. Eventually I'll get around to writing my own app to do this, but for now the Tasker/Forms method does the job nicely.

As a bit of a background, I've used this setup to start automatically tracking what time I wake up each morning. I find that I'm happier and more productive when I'm getting up early, so in order to help quantify this metric, I've created a Tasker profile that submits a Google Form when I unplug my phone in the morning, auto-magically recording the time I woke up. The best part about keeping the data in Google Spreadsheets is that it allows you the flexibility of creating your own charts, visualising and manipulating the data as you please. Here's how I did it:



Set Up the Google Form

  1. Create a new Google Form.
  2. Edit the first question and ensure the Question Type is set to Text.
  3. Give the field a Question Title of whatever you like.
  4. Delete the second question, you won't be needing it.
  5. Save the Form.

Make note of the link at the bottom of the page - the one indicated by ‘You can view the published form here:’, especially the part after formkey=. You'll need these details later when setting up the task in Tasker.

Create a Task in Tasker


After performing the following steps with Tasker in Android you should end up with a screen similar to this:
  1. Open up Tasker, select the Tasks -> New Task.
  2. Give the task the name of the item you want to track. I'm tracking my wake up times so I called the task Wake Up
  3. Now select Add Action -> Net -> HTTP Post
  4. Enter the following details in the HTTP Post fields:
    • Server:Port = spreadsheets.google.com (this could be spreadsheets0.google.com or sreadsheets1.google.com, depending on the the actual link of your form)
    • Path = fromResponse?formkey=<insert form key> (the form key is the part of the url you copied earlier after the formkey= part of that url)
    • Data = entry.0.single=<item name> (insert whatever you like here - this will identify the instances of the item you are tracking in the spreadsheet)
  5. Select Done.
If you like, you can add a Notify Action to your Task to confirm that your submit has succeeded. I have one and set it up as follows:
  1. On the same Task dialogue select Add Action -> Alert -> Notify
  2. Set the title and select a icon that suits your tracked item. Personally, I set my to 'You woke up at %TIME' (the time the Task executes will be inserted into the %TIME variable).

Add a Shortcut to the Home Screen


Now in order to use the Task you can add shortcut to the Home Screen (I'll let you figure out automatic submitting via a profile on your own):
  1. Long press the Home Screen.
  2. Select Shortcut -> Task.
  3. Select the task you've created (play with the options if you like), and...
Your done! One button press to keeping track of anything in your life, with all the power of Charts in Google Spreadsheets to help you visualise and make sense of your data.

0 comments:

Post a Comment