What is the difference between View and SurfaceView? Which one should be used for getting better and fast results? Why SurfaceHolder is used in SurfaceView?
Asked
Active
Viewed 344 times
1
-
View is parent for [SurfaceView](http://developer.android.com/reference/android/view/SurfaceView.html) and every other *View class. – M G Aug 07 '13 at 21:16
-
WHat is it you are trying to do? "Better and faster results" - meaning what? – Karakuri Aug 07 '13 at 21:20
-
yes thats what i am trying – Taimour Aug 07 '13 at 21:35
-
We know you're trying, but what does better and faster mean? Better what? What does "better" mean? What does "faster" mean? Faster coding? Faster compilation? Faster rendering of text? Faster drawing bitmaps? – Simon Aug 07 '13 at 21:48
-
I mean better and faster drawing,speed and redrawing(next frames). – Taimour Aug 07 '13 at 21:51
1 Answers
2
A SurfaceView behaves just like a View.
If you need to draw a static component (such TextViews) you should use a View.
A SurfaceView must be used if you need to draw your view several times (such in a video player, a game, animation and so on), with the SurfaceHolder you can draw your view in a off-screen Canvas and post it to be drawn in the SurfaceView (also called Double-Buffering) it's usefull if you want to draw in a Thread.

Marcos Vasconcelos
- 18,136
- 30
- 106
- 167