Difference between SurfaceView and View?
Views are all drawn on the same GUI thread which is also used for all user interaction.
So if you need to update GUI rapidly or if the rendering takes too much time and affects user experience then use SurfaceView
.
Difference between SurfaceView and ImageView
Some advantages and differences of a surface view:
Better rendering mechanism. threads can update the surface's content without using a handler. This helps for better performance in games and too much animation.
So if you need to update GUI rapidly or if the rendering takes too much time and affects user experience then Surfaceview is advisable instead of imageview.Surfaceviews cannot be transparent, they can only appear behind other elements in the view hierarchy.
Surfaceview has dedicated buffer, too. So it costs more resources than imageview and other views.
Here is a reference links which you could refer to understand better.
Difference between SurfaceView and View?
Hope this clears some doubt.
What's differences between Surfaceview and TextureView?
TextureView
A TextureView can be used to display a content stream. Such a content stream can for instance be a video or an OpenGL scene.
Example :
https://github.com/dalinaum/TextureViewDemo
Document:
http://developer.android.com/reference/android/view/TextureView.html
SurfaceView
Provides a dedicated drawing surface embedded inside of a view hierarchy.
Examples :
http://www.mindfiresolutions.com/Using-Surface-View-for-Android-1659.php
http://blog.wisecells.com/2012/06/04/surface-view-android/
Document:
http://developer.android.com/reference/android/view/SurfaceView.html
Difference between SurfaceView and GLSurfaceView in Android
A GLSurfaceView
is a SurfaceView
that you can render into with OpenGL. Choosing between them is simple:
- If you're familiar with OpenGL and need what it provides, use a
GLSurfaceView
. - Otherwise, use a
SurfaceView
.
OpenGL is low-level. If you're not already familiar with it, it's an undertaking to learn. If you only need 2D drawing, SurfaceView
uses the high-level, reasonably high-performance Canvas. It's very easy to work with.
Unless you have a strong reason to use a GLSurfaceView
, you should use a regular SurfaceView
. I would suggest that if you don't already know that you need GL, then you probably don't.
View and SurfaceView, which one is better?
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.
VideoView vs SurfaceView - Android
Frankly Speaking,
VideoView is the combination of SurfaceView and MediaPlayer,
VideoView = SurfaceView + MediaPlayer
But advantage of using Surfaceview and MediaPlayer separately is that you will have the ability to customize it.
I just used VideoView few days ago in my app. I actually had the same confusion. Since, then I came to know about it. I used VideoView. Here is the link below
Link
Hope it helps
SurfaceView colour differences between SurfaceView and View
I guess the SurfaceView is not using 32bit color. Try getHolder().setFormat(PixelFormat.RGBA_8888);
Related Topics
Why Was "Avoid Enums Where You Only Need Ints" Removed from Android's Performance Tips
How to Programmatically Set the Background Color Gradient on a Custom Title Bar
How to Display Progress While Loading a Url to Webview in Android
How to Access Fragment's Child Views Inside Fragment's Parent Activity
App Not Run in Visual Studio Emulator for Android in Visual Studio 2015
How to Simulate Android Killing My Process
Cannot Resolve Symbol 'Appcompatactivity'
Get the Latest Fragment in Backstack
Show and Hide a View With a Slide Up/Down Animation
How to Use the Paid Version of My App as a "Key" to the Free Version
What Is the Use of the Res/Values/Public.Xml File on Android
How to Change the Size of a Switch Widget
How to Change Textcolor in Alertdialog
How to Force Stop My Android Application Programmatically
Android: How to Make Keyboard Enter Button Say "Search" and Handle Its Click