Google I/O was a firehose of learning.
Hi, everyone,
I’m Jason Alderman, a partner-in-crime of Matthias on Android hacking projects, and I’ll be guest-blogging here every now and then. (Thanks much, Matthias.)
Google hosted I/O in San Francisco last week, an intense (see post title!) developer-centric two-day conference on hacking with Google technologies. As was the case last year, there were a lot of sessions on Android, and Google will be posting videos of those sessions to YouTube Thursday. I was lucky enough to make it out to I/O, score one of the new Ion dev phones, and sit in on nearly all of the Android sessions.

Most of the sessions were VERY engineering and dev centric… as one might expect from a Google conference. Here’s a run-down of the Android keynote and sessions, before the videos are all live on the I/O site….
The end of the Day 1 Keynote
introduced some of the new features of the forthcoming release after 1.5 (Cupcake), nicknamed “Donut.”
- The web search widget becomes a system-wide search, a la OS X or Vista’s searchbars. All that’s necessary is a “couple of lines of XML” in your app.
- The new text-to-speech (TTS) API will be multilingual, with proper accents (more on this later in the post). TTS voices aren’t perfect yet, but it was pretty darn impressive, and pushes Android devices into “universal translator” territory.
- The Android dev team has been experimenting with gestures on the touchscreen, such as writing letters with your finger to filter a contacts list. Could be handy, especially for hands-free use.
If you want to watch just the Android part of the keynote, skip to 2:34 in.
(Of course, at the end of the keynote, they gave everyone in the room an Android phone, instantly making tons of developers interested in Android development. The sessions were packed until the Google Wave sessions thankfully thinned the ranks the following day.)
Dan Morrill’s How Do I Code Thee
talked about four ways to write Android apps:
- managed code (Java/Dalvik),
- AJAX (web apps hosted inside a WebView),
- native code (C with libc and libm), and
- “Augmented AJAX” (where you provide hooks to Java code in a WebView that can be called by the JavaScript on the page).
Interesting takeaways:
- They’re working on an NDK (Native Development Kit) to complement the SDK.
- Android 1.5′s Browser is WebKit 4 (Safari 4 engine) with SquirrelFish, but the user-agent wasn’t updated (oops) to reflect this.
- The “augmented AJAX” approach uses WebView.addJavascriptInterface(), which lets you call Java or native code from within the javascript methods on a page.
All of the code from this presentation is up at http://code.google.com/p/hdict/.
Chris Nesladek’s Pixel Perfect Code
was a good presentation for people completely new to the platform. For the most part it touched on the new UI Guidelines that Chris and the Android team have posted in the past few days. If you have not yet looked at the UI guidelines, please go read this documentation. One of the things I can’t thank the Android team for enough is the work they’ve poured into cleaning up and updating the Dev Guide for 1.5. There are now detailed design guidelines for icons and widgets (with templates!) and activity and task interaction design guidance.
Interesting takeaways:
- Chris pointed out the new <android:dither=”true”> attribute can help prevent unintended gradient banding in 9-patches, so you no longer need to add noise in Photoshop.
- Toast pop-ups should be used when the user has attention on the screen, while modal dialog boxes should be used if the action is going to “harm the user” (delete e-mail, run out of battery, etc.).
- The 9-patch tool is very handy.
- The “Spare Parts” app (a dev tool that lets you tweak settings) is also very handy.
Jeff Sharkey’s Coding for Life
was helpful to both devs and Android users in general, because it noted what actions eat up your battery life.
Interesting takeaways:
- Waking up in the background is costly, so the new setInexactRepeating() can let the system bin together updates (e.g., checking for mail, news, and twitter posts at the same time) for fewer wake-ups.
- Parsing text from XML or JSON with a tree parser takes longer than using an event/stream parser, so devs should use XmlPullParser for XML or Jackson for JSON, or use something like binary Protocol Buffers.
- If you have an activity that needs to keep the screen awake, using <android:keepScreenOn=”true”> in your layout is safer, and a better practice, than an in-code wakelock.

Jeff Sharkey's battery life takeaways
Dave Sparks’ Noisy Androids: Mastering The Media Framework
was a little bit too in the weeds for me as a designer. I only caught the first half, so I’ll go back and watch it later to make sure I didn’t miss anything (I’m a completist!), but if understanding the way that Android plays video and audio is important for your app, check it out.
Chris Pruett’s Writing Real-Time Games For Android
was essentially an overview of an open-source game framework that he and a few others have been working on. If you’re curious about OpenGL2D drawing vs. Canvas drawing, and what ways you can tweak a game to make it as fast as can be, this session is for you. Look out for the open-source game, a cute side-scroller dubbed “Replica Island,” later this year. (It looked like a lot of fun to play!)

Justin Mattson’s Debugging Arts of the Ninja Masters
was a good overview of the tools in the SDK that can help you debug your app; a detailed look at how to use these tools; and general ways to approach debugging Android code. Admittedly dev-centric, but very much worth watching.
Interesting takeaways:
- logcat, traceview, and hierarchy viewer are your debugging BFF.
- Flat visual-tree hierarchies (those without a lot of nested layout elements) are better and generally draw faster, so the Android team recommends using RelativeLayouts whenever possible, instead of a slew of nested LinearLayouts. Some excessively deep UI hierarchies will actually no longer work in 1.5.
TV Raman and Charles Chen’s Eyes-Free Interaction on Android
was not just about accessibility for blind users, but about ways that accessibility techniques could help any Android user who isn’t able to keep her eyes on the screen at all times. A tremendously entertaining presentation with lots of demos and anecdotes, I especially recommend watching this if you’re interested in novel, experimental approaches to UI. All of their code is available at eyes-free.googlecode.com, and they’ve even got a YouTube channel, if you can’t wait for the session video to be posted to see what I’m talking about.On top of all this, the code methods above for text-to-speech (TTS) will be integrated into Donut’s SDK. You can start playing with TTS now, and not have to relearn new methods, with the guarantee of better-quality voices in Donut.
Romain Guy‘s Turbocharge Your UI
was also one not to miss. It focused on things like Adapters, background images, efficient screen drawing, and lots of tips on Views (pointing out objects like the useful ViewStub)—essentially, walking through, in slides, several of the Android dev team’s recent blog posts on UI. Very helpful stuff.

Finally, Romain and Joe Onarato’s Supporting Multiple Devices With One Binary,
one of the last Android sessions of the conference, is also very much worth watching, because it is not actually about what you’d think from its title! Joe and Romain talk about different device screen sizes, but then they get into a hands-on, elbow-deep-in-code walkthrough of writing your own layout (a custom ViewGroup), then checking it in to the open-source project. The fact that this presentation covered these two Very Useful Things was rather underadvertised in the I/O literature, but the speakers spread the word, and the session was a packed house.
Interesting takeaways:
- Donut will support three screen “densities,” the G1′s HVGA, the smaller QVGA, and the larger WVGA.
- The Android dev team has to use the command line tools instead of the most-excellent Eclipse plug-ins…? Not sure if this is because they’re switching back and forth between future releases and current ones, or because of some other way that the Eclipse ADT doesn’t fit their particular workflow. Will have to rewatch this video to find out.
- repo is something you should learn more about if you intend to commit code to the open-source project.
And that’s about the whole of it.

I met lots of interesting folks, saw some really interesting demos, observed ROBOT CAMERAS from a distance,…

… and overall, got motivated to start hacking my phone(s) again… which was the point of going to the conference in the first place.
Leave a comment