Day 1: finished Peepcode’s Javascript+AJAX tutorial. Good stuff. Always wondered what JSON stood for. JavaScript Object Notation … a human-readable data format for associative arrays. Nice.

Then, after some battling, a victory. I finally got my friend Tim’s android app prototype working using the MacOS Android cmd-line dev tools. This was surprisingly non-trivial since the Google docs are somewhat scattered. Plus I had skipped through them. In retrospect, the eclipse plugin may have been easier, but the ol’ UNIX shell scripter in me wanted to “install from first principles” (-;

Anyway, here are my steps:

  1. Install the SDK
  2. Set your shell’s PATH variable to include the location to your $SDK_ROOT/tools folder.
  3. Important yet easy to miss (as I did): The installed SDK does not include the platform images for the various versions of the Android OS. You need to install these manually using the management app which comes with the SDK: Run the android app from the cmd-line, select “Available packages”, and download the SDK Platforms you need. I went with 2.3.3 for my friend’s app, I also got 1.6 which my prehistoric (3yo) original Google phone is limited to.
  4. From the command line, check the packages are available - android list targets. Keep this list handy.
  5. Then create Android virtual devices (AVDs) for each OS level you want to run in the emulator: android create avd -n testavd -t 1 [the -t flag corresponds to the ID listed by the previous 'list targets' command]. You can also create or view these devices in the “virtual devices” tab of the android GUI.
  6. Run the emulator! At last! emulator -avd testavd [I CTRL-Z into the background, go and have a cup of tea - its slow]
  7. When it finally loads, the emulator should look like an Android phone. Navigate to the Phone Settings, and make sure the following option is enabled: Settings > Applications > Unknown sources (enabled)
  8. cd to your $SDK_ROOT
  9. Load your app: platform-tools/adb install ./SECRET-ANDROID-APP.apk
  10. Bingo! If the app does not appear, try restarting the phone.

Next: django vs. Rails