Category Archives: android

On this page:

Waking up with barcodes

I’d been looking for a wake-up alarm that was good at getting me up and out of bed. It turned out that I can solve a sequence of two-digit addition problems while half-asleep, so my previous alarm clock app still tempted me to snooze.

For the past two weeks, I’ve been trying a different alarm clock app. Morning Routine requires you to scan a barcode or a series of barcodes in order to turn off the alarm. After reading a Lifehacker post that mentioned it, I downloaded the app and set it up on my phone. I configured Morning Routine to require the barcode of a tub of cream cheese from the fridge. It turns out that the process of stumbling out of bed, stepping around the cats in the hallway, and opening the fridge is enough to wake me up and get me to start making breakfast.

The app doesn’t have a snooze button, so I can either wake up properly or shut down my phone. So far, I’ve been good at not shutting down my phone.

The developer’s blog post describes an even more fleshed out routine that involves barcodes in several rooms, with timers to get through the process. My morning wake-up-and-get-out-the-door routine typically takes an hour, but it might be interesting to set timers for the different components, or do a low-level time study of it. Hmmm.

Morning Routine is an Android app, and it’s currently available for free. Check it out in the Google Play store!

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>