Categories: geek » android

RSS - Atom - Subscribe via email

Learning Android development by hacking MobileOrg

| android, emacs, geek

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…)

View or add comments

Android: Tracking sleep with Sleep Bot

| android, geek

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.

View or add comments

I just got an Android phone

| android, geek
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… =) )

View or add comments