Eye Opener

This post by Nick Farina (via Daring Fireball) was a huge eye-opener for me on Android. He breaks down all the differences between Android and iOS, from dev environment to debugging to UI design tools, but the section on Animation was what slapped me in the face.
How Android deals with interactions (emphasis added):

If you pressed the Down key, you would expect the “Homepage” entry to be selected instead of “Go to.” So you press the Down key. This causes an “invalidate,” meaning, “please repaint the screen.” So the screen is cleared, then:

  • The OS redraws the status bar at the top
  • The WebView redraws the Google.com website
  • The Menu draws its translucent black background and border
  • All the menu text is drawn
  • The blue gradient highlight is drawn over “Homepage.”

This all happens very quickly, and you only ever see the final result, so it looks like just a few pixels have changed, but in fact the whole screen must be reconsidered and redrawn.

If this sounds familiar, it’s because this is the basic method used in GDI, the rendering system introduced with Microsoft Windows 1.0. That sounds damning, but really most GUIs operated this way.

Let’s see how iOS handles things:

When you’re using an iPhone, you’re playing a hardware-accelerated 3D game. You know, the kind of 3D where everything is made out of hundreds of little triangles.

When you flick through your list of friends in the Contacts app, you’re causing those triangles to move around. And there’s a “camera,” just like a 3D shooter, but the camera is fixed above the Contacts app’s virtual surface and so it appears 2D.

Which is a long way of saying that everything on iOS is drawn using OpenGL. This is why animation on iOS is so hopelessly fast. You may have noticed that -drawRect is not called for each frame of an animation. It’s called once, then you draw your lines and circles and text onto an OpenGL surface (which you didn’t even realize), then Core Animation moves these surfaces around like pulling on the strings of a marionette. All the final compositing for each frame is done in hardware by the GPU.

So when things just never feel quite as smooth as on iOS, there’s a reason. I wonder how much of this is relevant to webOS? Based on the chugginess of the UI in my few weeks of testing the TouchPad, I wouldn’t be surprised if it was.
As Nick mentions, Android began pre-iPhone. Horace Dediu of Asymco argues Google created Android as a defensive move to protect their existing revenue streams. They weren’t thinking about the future. The opposite was the case for Apple, they created the iPhone (and iOS) to create a new revenue stream. It was yet another chance to define what the future of mobile computing should look like.

Leave a Reply

Your email address will not be published. Required fields are marked *

To create code blocks or other preformatted text, indent by four spaces:

    This will be displayed in a monospaced font. The first four 
    spaces will be stripped off, but all other whitespace
    will be preserved.
    Markdown is turned off in code blocks:
     [This is not a link](http://example.com)

To create not a block, but an inline code span, use backticks:

Here is some inline `code`.

For more help see http://daringfireball.net/projects/markdown/syntax