Android: Developing w/ the SDK ADT bundle

This semester, I’m taking a course on Android development. So I’ll be posting a bit more Android-related stuff as we go along. I’m developing on the MacBook Air, so get comfy w/ the command line.

To get started, grab a copy of the Android SDK. The Android Development Toolkit (ADT) bundle is pretty awesome. It comes w/ Eclipse and the plugin all setup already:

I unzipped the .zip file in Downloads; i.e. /Users/kzhiwei/Downloads, so the full path would be something like:


Now you need to connect up your Android device (I use the Nexus S). The truth is, the ADT plugin comes w/ the Android Virtual Device (AVD) Manager. So you could, theoretically emulate any Android device, but the emulated device takes too long a time to boot up, it’s insane not to use a real hardware device. You’ll need to setup Android debugging: Settings > Developer options > On > Android debugging. There are two other useful options here: Stay awake and USB debugging notify. I keep them on, but it’s not mandatory.

Now, we’ll need to find out what is our device serial number. Fire up Terminal, and navigate to /Users/kzhiwei/Downloads/adt-bundle-mac-x86_64/adt/sdk/platform-tools:

woteba:platform-tools kzhiwei$ pwd
woteba:platform-tools kzhiwei$ ./adb devices
List of devices attached
3xxxxxxxxxxxxxxx device

I’ve masked out my device ID, of course. Just remember the starting digit, and then you are basically ready to start working w/ Eclipse. I do this by using the Finder, and then navigating to adt-bundle-mac-x86_64/eclipse. There’ll be an somewhere, so double-click, and then wait a bit. Now we’re ready.

File > New > Android Application Project. Under Application Name and Project Name, input “Foo”. Under package name, input “”. So it’s basically my domain name in reverse, plus the app name (foo). Next we’ll need to define SDK levels. The defaults are good enough:

Minimum: Froyo
Target: Jelly Bean
Compile with: Jelly Bean
Theme: Holo Light w/ Dark Action Bar

Stay with me! Click Next (just use the defaults for the next few pages). You should see your newly created project (Foo) in the Project Explorer. Right-click the project, and then Run As > Android Application. The first time you do that, there’ll be an option to choose either an AVD, or an Android hardware device. We’ll check our device, of course, and then check “Use same device for future launches”, and then go. There’ll be some activity on the device, and then your new application should run. It just says “Hello world!”. Awesome, we are done here.

Hopefully I’m really hardworking and I’ll continue posting up stuff w/ real code in a bit.


Eclipse "Open Resource" in Komodo Edit 5.2

The thing I like about Eclipse is its “Open Resource” shortcut. Eclipse is great, but it always feels… heavy. Plus I can’t get Mint 7/Eclipse 3.5/PHP Developer Tools to play nice, so I’m switching to Komodo Edit 5.2. It doesn’t work so well with CakePHP, but at least there is some code completion. Now the previous version (5.1) was extremely unstable, but the new one is much better, so try it out if you’re looking around for a new editor.

Now, on to the good stuff. You can duplicate “Open Resource” by creating a project and defining a shortcut for Komodo’s equivalent:

File -> New -> New Project

Save the file in the root of your project directory. This allows the entire file listing to show up in:

File -> Open -> Go to File…

Finally, you need to define the Ctrl+Shift+R shortcut for it:

Edit -> Preferences -> Key Binding Schemes -> New…

I call mine “Eclipse”.

In the “Commands:” input box, type “go to”, and then select “Fast Open: Go to File…”.

Restart Komodo Edit, open the project you just created, and then hit Ctrl+Shift+R. Voila.

Goodbye, Eclipse.