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 <ayanir...@gmail.com> wrote:



--
Dianne Hackborn
Android framework engineer
hack...@android.com

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. Emulator is Crashing

I just ran through the sample Hello, Android project, and every time I
try to run it the Emulator crashes. I did this with and without the
suggested changes, each time it crashed.

Any ideas of what is causing this? I searched for related threads but
nothing posted about this early in the process.



--~--~---------~--~----~------------~-------~--~----~

2. syncing with pc

I need to write an offline application that will be able to sync with
the pc to transfer its data.  The app provides some data entry
capability, then the user connects it to the pc and view these data in
a desktop version of the app.
Will android be a good platform for what I described?  Does it provide
interface for syncing with pc and proprietory data transfer?

thanks!

--~--~---------~--~----~------------~-------~--~----~

3. Small help::

4. TabActivity vs VideoView vs Camera Preview contention

5. Android Mobile Applications Developer - Richmond, VA

6. Want a dialog

7. G1 Developer Version UMTS Band / Frequencies?