SurfaceViews handling, Thread, and general game design

by Dianne Hackborn » Wed, 15 Jul 2009 00:06:43 GMT

Sponsored Links
  very strongly recommend that you don't use multiple surface views.  A
surface view is a very heavy-weight object, and intended for the primary
area of the window -- for example, the video part of a video player, the
playfield of a game, etc. It is basically an overlay, and actually its own
separate full window that is simply being Z-ordered with your main window to
make it look like they are related.

I don't know what your "complicated" animation sequence is, but just having
some animation is not enough reason to use a surface view. Worst case, you
can just create an off-screen bitmap that you draw the animation in and
update the screen by drawing that bitmap to the screen with the normal
invalidate() mechanism. If you need the performance of a surface view, then
you should design your game so that your entire playfield is on surface
view, and you take care of drawing each of your boxes inside of that and
manage them however you want (not as their own views).

On Tue, Jul 14, 2009 at 4:27 AM, ayanir <> wrote:

Dianne Hackborn
Android framework engineer

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails. All such
questions should be posted on public forums, where I and others can see and
answer them.


Other Threads

1. Making a video of your app running

Is there some supported way of making a Video of your app running?
Seems kind of silly (and low quality) to have to point your camera at the


2. Open Source code into Eclipse

I want to import the source code for FourSquare into the Eclipse SDK,
how do I do that?  The source page says that I can get a copy of the
local repository with this command:

hg clone foursquared

What do I do with that command?



3. ADB & New Devices

4. Please help with Bitmap issue. I have screen shots!?!

5. Not Able to Browse Internet and Google Map on Emulator

6. Comments lost in the developer console and market app

7. HTC Desire (w/SenseUI) not properly decoding xml chars