Reputation: 8085
So this is a pretty general question, but I've been wondering about it for a while now and wanted to see if anyone had a suggestion on this.
In my previous experiences, as with some people's, using SurfaceViews and/or CanvasViews to display graphics, draw pixels, and do animations is very easy and straightforward. I personally use SurfaceViews more for animations since they are more optimized for it. I've realized from doing tests that SurfaceViews tent to lag a lot on certain phones (example: Motorola Droid) but run smoothly on others (example: Droid Incredible). I was wondering if anyone knows of views or display methods that run smoothly and are more efficient than SurfaceViews and/or CanvasViews, especially for animiations. Thanks a lot.
I primarily want to know this because I don't understand how some games can run so smoothly on my slower phones even though they have tons more animations than my simple game using a SurfaceView.
Upvotes: 2
Views: 837
Reputation: 3440
This question is answered really well by Chris Pruett in his presentations on creating real-time games for Android. He did two presentations but I think the first one: http://www.youtube.com/watch?v=U4Bk5rmIpic has it in.
In general terms, GLSurfaceView will always be better or equal to SurfaceView, however if you are only rendering a small number of objects then SurfaceView can appear to be better. As for the phone discrepancy, I believe his second presentation (I/O 2010) covers that in depth.
Upvotes: 2
Reputation: 4480
For those games with a lot of animation, it would be good to use GLSurfaceView , it's SurfaceView optimised with OpenGL ES . but I wonder too, because I've tested drawing using GLSurfaceView compared with SurfaceView , and the result is still better for SurfaceView. anyway there's no such thing as CanvasView. :)
Upvotes: 0