Difference Between Surfaceview and View

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:

  1. 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.

  2. Surfaceviews cannot be transparent, they can only appear behind other elements in the view hierarchy.

  3. 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



Leave a reply



Submit