Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's differences between Surfaceview and TextureView?

I've been studying Android especially View system. I have a question differences between them but there is no documents or references in my mother language. So I want to know from you guys.

like image 898
Won Chul Jo Avatar asked Jun 04 '13 11:06

Won Chul Jo


People also ask

What is TextureView in android?

android.view.TextureView. A TextureView can be used to display a content stream, such as that coming from a camera preview, a video, or an OpenGL scene. The content stream can come from the application's process as well as a remote process. TextureView can only be used in a hardware accelerated window.

What is SurfaceView?

Provides a dedicated drawing surface embedded inside of a view hierarchy. You can control the format of this surface and, if you like, its size; the SurfaceView takes care of placing the surface at the correct location on the screen.


1 Answers

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

like image 58
Chintan Rathod Avatar answered Oct 31 '22 17:10

Chintan Rathod