I am in the middle of writing an game and got curious what happens outside my code. I extended the View class with everything happing inside onDraw (updating the model and rendering it). Before onDraw is exited, a invalidate() is fired so the View gets repainted continously. With this approach I get 60 fps most of the time (sometimes it lacks behind shortly), which is OK for now. However, the game will get more complex, and I did some measuring with the following averages of painting one frame:
* My code inside onDraw consumes 5ms * Between the calls of onDraw 10ms are "consumed" So twice the time is spend outside my code: What exactly happens here? Is there just a 60fps maximum (causing the system to wait until the next frame is painted), or is there so much overhead going on behind the scene? I know about SurfaceView and decoupling the rendering from the GUI Thread, but I haven't tried that yet. To me, it did not seem to make a difference in which thread my game code is executed, so I stayed with the View so far. Markus --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---