Learn about Android Graphics & Animations from Google's Android UI Toolkit team

By: UserGroupsatGoogle

309   6   68361

Uploaded on 12/13/2010

Learn how to create awesome visuals and animations from Android UI Toolkit engineers, Romain Guy and Chet Haase.

In this presentation Romain and Chet will drill down into architecture, graphics and animations. You'll also get a look at some of the new Android API's coming in these areas.

** Get the slides from the event at http://marakana.com/f/212 **

Didn't make it to Devoxx 2K10? Well find out what you might have missed, as this is the same presentation Romain and Chet delivered at Devoxx. Through demos, slides, and code exmamples you will:

- get a detailed look at the Android architecture
- learn about formats, and how to optimize for performance
- get a few points on what's coming in Gingerbread
- learn about drawing tools (Paints, Shaders, ColorFilters, Xfermodes, and Bitmaps)
- How you can take advantage of animation to spice up your UI

** see more videos and tutorials on open source at: http://marakana.com/techtv **

Comments (2):

By anonymous    2017-09-20

[UPDATE] (Let me share what I've learned about Window after original answer)

In one sentence, A Window is a rectangular area which has one view hierarchy. Colored rectangles in below image are windows.

enter image description here

As you can see, there can be multiple windows in one screen, and WindowManager manages them. Window list in current screen can be obtained via Hierarchy Viewer, or adb shell dumpsys window.

Window list in Hierarchy Viewer example : enter image description here

(Below is original answer)


I had the same question, and I hope this could help you guys.

According to Android Developer Documentation,

"Each activity is given a window in which to draw its user interface."

and, Dianne Hackborn, who is a Android framework engineer, gave some definitions here. She said,

A window is basically like you think of a window on the desktop. It has a single Surface in which the contents of the window is rendered. An application interacts with the Window Manager to create windows; the Window Manager creates a Surface for each window and gives it to the application for drawing. The application can draw whatever it wants in the Surface; to the Window Manager it is just an opaque rectangle.

A Surface is an object holding pixels that are being composited to the screen. Every window you see on the screen (a dialog, your full-screen activity, the status bar) has its own surface that it draws in to, and Surface Flinger renders these to the final display in their correct Z-order. A surface typically has more than one buffer (usually two) to do double-buffered rendering: the application can be drawing its next UI state while the surface flinger is compositing the screen using the last buffer, without needing to wait for the application to finish drawing.

A View is an interactive UI element inside of a window. A window has a single view hierarchy attached to it, which provides all of the behavior of the window. Whenever the window needs to be redrawn (such as because a view has invalidated itself), this is done into the window's Surface. The Surface is locked, which returns a Canvas that can be used to draw into it. A draw traversal is done down the hierarchy, handing the Canvas down for each view to draw its part of the UI. Once done, the Surface is unlocked and posted so that the just drawn buffer is swapped to the foreground to then be composited to the screen by Surface Flinger.

Also, I found some other info from Romain Guy's presentation(You can watch his talk at San Francisco Android user group from here, and download full slides from here)

enter image description here

So, in a nutshell:

  • An Activity has a window (in which it draws its user interface),
  • a Window has a single Surface and a single view hierarchy attached to it,
  • a Surface include ViewGroup which holds views.

Original Thread

Recommended Books

    Popular Videos 3

    Submit Your Video

    If you have some great dev videos to share, please fill out this form.