September 5, 2010

Going Froyo on a Google G1 Dev Phone - with Processing on top

I recently upgraded my aging Google Dev Phone to the most recent version of Android. On top of that I installed Processings Android-capable build, so I can now write Android apps in a few familiar lines of Processing code.

Here's the steps it took. The guides online for doing this are quite good, but cover all kinds of caveats which make them harder to read than necessary, and makes the process look much more daunting than necessary.

Why you might not want to do this

I'm upgrading to Cyanogenmod 6, based on Android 2.2 - aka Froyo. That upgrades wipe whatever apps you had installed before, from your phone. I'm fine with that, but if you don't want to start over from a blank slate this is not for you.
Also, the upgrade wipes the list of APNs from your configuration - so take your current 3G settings and make a note of them, so you don't have to scour the internet to find them again when you set up your freshly built phone.
Also II: The upgrade also wipes all your text messages and call logs from your phone. Ritesh Sahu makes nice backup apps for both, so use those before the install if you care about your logs and texts. They're in the Android Market, just search for 'call log backup' or 'sms backup'.

How to

Note that, of course, I can't promise you this will work for you. This is what worked for me

First gather all the downloads you need for the install. These are, in order (I'm linking to guides with up to date links to downloads)

Amon Ra recovery image,
New radio firmware (<- maybe, I had this from a Jesusfreke install of 1.6 last summer, already),
DangerSPL,
Cyanogenmod 6,
Gapps - tiny version

- I'm assuming you're a developer kind of guy, so you probably have the Android SDK in some version already. You'll need the fastboot tool from the SDK during this process.
- I'm also assuming your phone is already rooted. This is the case for a Google Dev Phone.

What you want do to is read through the caveats and follow this guide

What that means in short, is:

  1. Power off your phone, connect it with USB to your laptop, reboot in fastboot mode - by holding the camera button down before and during the reboot
  2. Pay attention to the fourth line in the status of your phone - it lists the version number of your radio firmware. Make sure it's the most recent one (different ones for US and non-US, version numbers are in the guide). If you ever updated your radio before, you probably have the right one, but check it
  3. Install the Amon Ra recovery using the fastboot tool, as described in the guide, and reboot
  4. Mount the phone SD card via USB, and copy DangerSPL, Cyanogenmod, GApps and the radio image to the root of the SD card
  5. What you need to do now is a series of updates in recovery mode. Power off, boot into recovery by holding home before and during boot. Press back when booted
  6. Use the 'Flash zip from sdcard' option, flash the radio image you copied, if you need to upgrade the radio
  7. If the radio update rebooted you into std mode, power off and reboot back into recovery mode
  8. Flash zip, again - this time the DangerSPL zip. - this is where you can brick your phone if you weren't careful with the radio image version
  9. Your phone should reboot back into recovery mode, and you can do the last bits in one step: Use Wipe|Wipe data/factory reset first, then go back to the main menu and first flash the Cyanogen zip, then the gapps zip
  10. When you reboot now, you'll be booting into a virgin Froyo phone, and you will ned to go through the configuration process for that. This is where you might need to set up your APN, and your notes from earlier will come in handy
  11. Your phone will seem slow. That's because the JIT isn't enabled by default! Go to Settings|Cyanogenmod settings|Performance settings and enable JIT. Change some of the graphics performance options also, if you care about speed and battery. Reboot.
  12. You'll be missing some apps. Go to the market and download Google Maps and 'Wireless tether for root users'
  13. For bonus points, download Chrome to phone to show off this neato browser integration (add fox to phone if you use Firefox)

And now for simple 2d/3d media application development

You might have the android SDK already, make sure you have API version 7 in your SDK setup. To do that, find the 'android' executable, which is the SDK manager, and make sure your SDK includes API 7. You upgrade the SDK from within the manager if these are missing. You need both the API 7 itself and the "Google libs for API 7".
Now get the experimental build of Processing that includes android support.
After installation, Processing will ask for the location of your SDK, when you try to enable Android support for a sketch (which is Processing's name for projects). A little gotcha here: When you try to build for your phone, Android will use a development certificate to sign your app. These can get stale, and your build will fail. Just delete it, and rebuild, to fix. On OS X - what I run - it should be ~/.android/debug.keystore you want to delete.

Now grab one of the simple Android examples from the File|Examples menu - I went for a simple 2D sketch demonstrating mouse input. Drop the code from that into your Android-enabled sketch (or Android-enable the example sketch) and build. Running the sketch should happen in the emulator. To copy it to your phone use the 'Present' option from your build menu.

Posted by Claus at September 5, 2010 4:03 PM
Comments
Post a comment