Category Archives: android

I just got an Android phone

From Phone

Thanks to W’s fine research and comparison shopping, I bought an Android phone off Craigslist. I’ve just installed Tasker and a whole bunch of other apps, and I can’t wait to try all sorts of experiments. I’m looking forward to mobile development, too! (… and yes, MobileOrg was one of the first things I installed… =) )

Android: Tracking sleep with Sleep Bot

I recently switched to an early-morning schedule, just for fun. Tracking my sleep helps me motivate myself to go to bed when I promised to and wake up when my alarm goes off, and it comes with useful bonuses too. I had been using the Sleep On It application on my iPod Touch to track my sleep and set my alarm. When I switched to an Android phone, one of the first applications I installed was for sleep tracking as well.

Sleep Bot Tracker Log is a fantastic sleep tracker – and it’s free. The basics: you “clock in” by clicking on the going to sleep button, which changes to a waking up button. When you wake up, you can hit the snooze button (if you’ve configured snooze) or slide your finger across the screen in order to clear the alarm. Using Sleep Bot to track your sleep means that you can view your sleep data as a graph, graph, table, or comma-separated export file – good for keeping yourself accountable.


You can set an alarm by clicking on the small alarm clock icon in the upper right. I particularly like the ability to see how much time is left before the alarm goes off, which helps me figure out how much time I have before I should go to bed. You can set the alarm tone to ringtones or songs, and configure it to fade in gradually.

You’ll also see the alarm countdown on the Android lock screen – great for a quick check. As last night’s lock screen shows on the right, I stayed up a little bit late.

alarm-settingsalarm-detail device


But wait, there’s more. Sleep Bot makes it easy to set all sorts of useful settings to help you stay asleep. I’ve told it to avoid calls, set my phone to silent + vibrate, and turn off WiFi to minimize late-night disturbances. Configuring it is also simpler than configuring similar rules using Tracker, Locale, or other context-sensitive Android applications.


Look up the free Sleep Bot  Tracker Log application on your Android phone with this handy QR code. You can add the widget to your home screen for even faster checking in. Recommend.

Learning Android development by hacking MobileOrg

I spent most of Saturday plunging into Android development, starting from the Hello World and Notepad tutorials. It was lots of fun. I wanted to use MobileOrg on Android, but it lacked a lot of things that were in MobileOrg for iPhone, so I taught myself Android development by fixing little things that a newbie like me could do.

First: I wanted the capture form to resize itself when the soft keyboard was displayed, instead of letting the virtual keyboard hide the Save button. Fortunately, I’d come across a solution while reading the technical articles on resize the activity based on the onscreen input method. I tested it on my system, then reported the issue and the fix through MobileOrg’s github. Within a few hours, the fix was included in the project. Yay! (It took me a while to figure out I could use the back button to hide the keyboard, but it was a productive while.)

Second: The editing interface was functional but not convenient , so I dug into views and layouts and all sorts of niftiness. Before and after:

edit-before   after

(… and it’s all wired up and working, at least for me!)

Mwahaha! Along the way, I ended up learning about org-mobile.el and how to set up a somewhat finicky configuration so that I could synchronize my files over Dropbox onto my SD card and into MobileOrg, and then back over Dropbox and into my computer. It’s not fully automatic, but the pieces are mostly connected now. The relevant parts of my experimental config:

(setq org-mobile-directory "~/dropbox/mobile")
(setq org-mobile-inbox-for-pull "~/personal/")
(setq default-buffer-file-coding-system 'utf-8)
(setq org-mobile-files '("~/personal/" "~/personal/" "~/personal/"))
(setq org-mobile-agendas '("a"))

Then I used M-x org-mobile-push to sync  things up. There was a bit of a kerfluffle I had to sort out. I moved files around, so I needed to delete the /sdcard/mobileorg database on my Android, and I also needed to download the checksums and other files using Dropbox before loading them in MobileOrg. But things work reasonably well now, I think, and I can browse my Org files and capture some updates. Whee!

 main organizer outline2

… and so on.

Next step: Talk to my manager about open source approvals so that I can share my patches with the community. There’s still plenty more to build on top of MobileOrg, but at least I’ve taken care of the two big things that were getting in my way.

I’ll have to decide whether I’m going to build my other app ideas as separate lightweight apps, or be evil and store as much data as I can into Org… >:) Hmm. Org as grocery list, price tracker, inventory management, and  recipe database? Org as sewing organizer for patterns, notions, fabric, measurements, and projects? Org as a hammer for an unbelievable variety of nails?


(Okay, maybe I’ll build things for SQLite first, but there’ll probably be some kind of .org or CSV eventually…)

Quantified Self Toronto: Second Meetup

I went to last night’s Quantified Self Toronto meetup, a get-together for people who are interested in tracking data about their lives. It was good to hear about people’s projects and questions. I shared what I’d been doing with my new Android phone, too. Here are my notes:

For me, the most interesting point was that of analyzing the data you already have in order to understand your patterns.

Correction: I haven’t just had my phone for three days, I’ve had it for a week. (Ah, time flies when you’re having fun.) I’ve only been tracking activities for three days, though, so I guess that’s why that number got stuck in my brain. =)

What do I track, why do I track it, and how do I track it?

I want to experiment with getting up earlier, and to see if I still get enough sleep. I knew that tracking would help me stick to my alarm clock, like the way that tracking time helps me stay focused. I’ve written about tracking my sleep, so you can check out the detailed screenshots there. So far, I’ve been waking up within a few minutes of 5 AM, getting an average of seven hours of sleep, and feeling reasonably awake and energetic.

I want to capture and share as much as possible. On my computer, Org-mode is working well for me – big text files that I dump notes into, with a bit of structure along the way. I’d like to have a structured way to capture notes on my Android, particularly if I can pull those notes into my Org-mode text files. I haven’t settled on any one application yet, although I’m working on tweaking MobileOrg to fit me better. I’m also playing around with mindmapping (Thinking Space supports Freemind maps), and I’m looking for a good way to keep outlined lists.

I want to track how much time I spend on different activities. This will be useful for calibrating my time estimates, comparing my time with my priorities, and identifying opportunities to improve. This definitely has to be a mobile app, as I do things away from the computer too. Time Recording has been working well for me so far.

I want to track my finances. I do this on my laptop so that I can take advantage of all the wonderful reporting tools that the ledger command-line tool gives me. I’ve figured out a virtual envelope-based system that works for me, and I enjoy balancing my books. I don’t particularly feel the need to use my Android to capture this data, as I try to keep my transactions electronic. The occasional note about cash expenses can be handy, though.

I eventually want to get better at tracking my contacts. I like the way Gist gives me a dashboard sorted by importance or filtered by tags. I want to get to the point of deliberately reaching out to people on a regular schedule.


Monthly review: October 2010

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.

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


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-.


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.


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">
    <class cl="Action" sr="act1">
      <class cl="IntArg" sr="arg0">
    <class cl="Action" sr="act0">
      <class cl="IntArg" sr="arg4">
      <class cl="IntArg" sr="arg3">
      <class cl="IntArg" sr="arg2">
      <class cl="IntArg" sr="arg1">
      <class cl="IntArg" sr="arg0">
  <class cl="Profile" sr="prof15">
    <nme>Angry birds</nme>
    <class cl="AppContext" sr="con0" ve="2">
      <label0>Angry Birds</label0>