Category Archives: android

Quantified Awesome: How I’m starting to use Tap Log for Android

At Rails Pub Nite the other week, Andrew Louis showed me his timestamped-based self-tracker inspired by Your Flowing Data and similar semi-structured text entry systems. He had a year of data in his system, and had built a fascinating dashboard. 

Nudged by the idea, I moved from using Time Recording to capturing timestamped data, and started using Tap Log for data entry because it lets me set up categories for quick entry.

I wanted to use Tap Log to capture the following types of data:

  • activities (work, sleep, etc.) so that I can do weekly and long-term time analysis
  • meals, so that I can get a sense of what I eat and when
  • thoughts, so that I can jot quick ideas, keep track of things I need to follow up on, and copy information into other systems
  • moods / feelings

screenshot_11I’ve set up my Tap Log to start with high-level categories. From this screen, I can quickly enter text or choose an activity.

The “Text” button is in yellow, which means that the next screen will have a text entry screen. “Sleep” is in red, which means that it needs no additional input – it creates a log entry, and that’s it. Entries like “Discretionary” lead to other menus, which are set up similarly.

For example, if I’m planning to write, I’d start by tapping “Discretionary”, then “Writing”, and I’d add a note about writing for my blog. 

screenshot_20You can have up to three levels of categories. Timestamped entries can be associated with numbers, ratings (1-5), or text. You can review log entries in the application itself, or you can export the log as a CSV and process it yourself.

The CSV will give you the following data:

  • latitude, longitude, altitude, accuracy, gpstime, street, city, state, country, zip
  • samples, _id
  • timestamp, DayOfYear, DayOfMonth, DayOfWeek, TimeOfDay
  • catOne, catTwo, catThree
  • number, rating, note

For my use, I focus on _id (for updates), timestamp, catOne, catTwo, catThree, number, and note. I usually keep GPS off on my Google Nexus One in order to save battery. Besides, GPS performance on that phone isn’t very good. W- wins our GPS battles all the time thanks to his trusty N8. You might find the GPS tagging handy, though.

Because I’m interested in activity tracking, I need to infer ending timestamps from the data. Some of my records are associated with activities. Some of them capture other data, such as thoughts. Here’s the basic idea behind my code:

  • Read each timestamp and copy it into my database, updating the record if it already exists
  • Re-sort the records by timestamp
  • Delete time records for this period
  • For each timestamp in the updated period:
    • If this is an activity (based on the category)
      • Close the last activity and save it as an activity record
      • Set the last activity to the current activity

I also added some text analysis to look for notes tagged with !memory, !todo, !private, and other tags I’m starting to find handy.

Tada! http://quantifiedawesome.com/tap_log_records:

image

and activity graphs at http://quantifiedawesome.com/time/graph:

image

Observations: I like the ability to capture text and ratings quickly, and I look forward to taking advantage of that. I’ve been tracking activities just as much as I did on Time Recording, so the lack of on-phone activity summaries hasn’t gotten in my way.

What would make this even better? I’d like built-in time tracking, although that might mean that people would need to indicate which buttons correspond to activities. I’d like to have full Tasker integration so that I can automatically create entries based on different events, but I can get around that by logging the information separately and then merging it based on time. Sometimes I wish I could have four or five levels of categories, but I can use text for now. Mostly, I just need to keep adding to the analysis tools I’ve been building on Quantified Awesome: tags, activities, summaries, paging, and so on.

So that’s where I am. Let’s see where this helps me go!

13,705 steps and counting

Walking

13,705 steps in two and a half hours of leisurely walks spread out over one day, encompassing three not-entirely-necessary strolls involving two libraries, a drugstore, and one supermarket. But it was worth it: several bags of books, a package of dental floss, a pantry restocked with instant noodles, and the satisfaction of seeing what it’s like to walk the recommended 12,000 steps.

I headed out for the second half of my walk right after we wrapped up a project. The euphoria was making me buzz too much to write, so I decided to take good long walk.

The streets here are wide and well-lit, and our neighbourhood is wonderfully walkable. The largest park in Toronto is a few blocks from our house, although I more often walk to the library and to Bloor West Village. Near work, underground passages let me wander about while hiding from winter.

I enjoy walking. Even when winter’s giving me the sniffles, it’s still fun. Sometimes I think of Elizabeth Bennet walking from Longbourn to Netherfield (three miles, or a mile less than what I walked today), except in better shoes and more comfortable clothes (but not anywhere near as awesome a hat).

Tracking has certainly influenced my behaviour. I’ve taken to using Walttend Lite to track my steps because it can correctly track on my Google Nexus One even when the screen is off. None of the other pedometer apps I tried could do that, so Walttend it is. Once I was out there, it was easy to talk myself into going just a little bit further so that I could check off my 12,000 goal. After all, when you’ve gotten to the vicinity of 10k with another trip to the library (and another armful of books), you might as well keep going.

Do you use a pedometer to track your walks? What are you learning?

Photo (c) 2009 Tambako the Jaguar – Creative Commons Attribution No Derivatives

Emacs, BBDB, and getting your contacts on the Android or iPhone

Want your Emacs BBDB contacts on your Android or iPhone?

The easiest way I’ve found is to export your contacts to CSV, then import them into something like Google Contacts. You can export your BBDB contacts using bbdb-to-outlook.el, which is available in the BBDB package in the bits/ directory. Download bbdb-to-outlook.el from Sourceforge if you can’t find it in your BBDB directory. To use:

  1. Load bbdb-to-outlook.el and use M-x eval-buffer to load the code.
  2. Use M-x bbdb to open your BBDB records, and search for . to show all the records. Alternatively, search for a subset of your records.
  3. Type O to run bbdb-to-outlook and choose the file.

Tada! Step one done. Review the file and delete anything you don’t want to include.

To import the contacts into Google Contacts, go to Google Mail and click on Contacts. Click on Import and choose your file. After some time and some fiddling, you can get that synchronized onto your Android or iPhone.

I haven’t thought about syncing, but I’m trying to keep my BBDB as The Master File for Contacts anyway, as it’s so much more flexible than any other contact database I’ve tried. (Although gist.com is pretty cool and I do like the Android’s merging of photos, contact info, and updates…)

There was some work on synchronizing BBDB with the Palm, so that might be a possibility.

Enjoy!

More MobileOrg hacking on the Android

I’ve gotten IBM’s permission to contribute my changes back to the MobileOrg project, yay! (Disclaimer: I’m doing this as myself and not as an employee of IBM, and all the usual disclaimers apply.) Code and issue-tracking at https://github.com/sachac/mobileorg-android.

Before and after:

editbefore[1] image

There are still bugs to work out, but whee!

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>

Android life so far

It’s been three weeks since I bought my Android phone, and I’m having lots of fun hacking it. Here’s what I’m doing with it now:

  • Tracking the time I spend on various activities so that I can (a) get better at estimating time for travel and other things, (b) log my work hours, and (c) find out where my time really went.
    Experimenting with grocery tracking systems so that I can organize my shopping list and track prices. GTracker seems okay, although there are a bunch of features I still want, so I might build my own someday.
  • Synchronizing my files with Dropbox, reviewing spreadsheets, and using the files in various applications.
  • Mindmapping with ThinkingSpace, which understands Freemind files I’ve downloaded with Dropbox.
  • Taking pictures and sharing them on Facebook and Picasa.
  • Capturing notes, mostly with MobileOrg. Still tweaking this.

What am I working on being able to do with my Android?

  • Retrieve contact data from BBDB: I’m most of the way to being able to show records from the Emacs Big Brother Database in my Android contacts. Mwahaha! I’ve figured out how to parse the records with StringTokenizer, interpret the alists, add information to records, and add records to visible groups. I just want to set up a new account manager for BBDB, and then group the items using mail aliases. It took me a while to piece things together from bits of documentation and tutorials. I’m looking forward to applying for permission to share my BBDB stuff as open source, too.
  • Improve Org interface: I’m also most of the way towards making the MobileOrg capture interface close to the MobileOrg iOS capture interface, which I had been quite happy with. You
  • Check my Toodledo tasks: None of the Toodledo clients I’ve tried are as slick as Toodledo for iOS. Who knows, this might just push me back into using Emacs Org to manage everything, with my org-toodledo for syncing to the Web.
  • Get better at using a timer: Not quite Pomodoro technique, more like a timer just to remind myself to stop doing something. =) The open source Tea Timer is a decent fit, and I’ve kludged it on my phone to make it easier to add multiples of five minutes.
  • Track my time in more detail: Maybe with task-level tracking, or finer categories for the things I care about?

What am I learning?

Looking at my preliminary stats from a little over two weeks of tracking, I’m pleasantly surprised by how much time I spent on social interaction – more than I thought I did, looking back. I also get a decent amount of walking and other exercise into my schedule. It takes me about 13 minutes to walk to the subway station, and the subway ride to work takes an average of 19 minutes – a little over my estimate of 30 minutes travel time. I’ve been putting that time to good use, listening to podcasts while walking, and writing Christmas cards if I can get a seat.

I might shift our preparation routines around so that I can move more non-computer things into weekday evenings. I want to do more blogging and Android development in my personal time. Even though I take frequent typing breaks to avoid those pangs of incipient RSI, a long day of working on the computer is probably still a bad idea. ;) Most of our weekend preparations involve laundry or cooking. Both are more efficiently batched on the weekends – cheaper electricity, too. Tidying up and folding laundry can be done as a break that separates work from evenings. Drawing might exercise different muscles (and different parts of my brain). Investing time into training speech recognition might pay off, too, although I get self-conscious about dictating when other people are around. <laugh>

Definitely like my Android.