Home » Android » android – setPreviewDisplay vs setPreviewTexture

android – setPreviewDisplay vs setPreviewTexture

Posted by: admin May 14, 2020 Leave a comment


When opening the Android camera, either a SurfaceHolder or an OpenGL SurfaceTexture must be set to hold the displayed images, using setPreviewDisplay() (API level 1) or setPreviewTexture() (API level 11), respectively. Is there any difference in speed, device compatibility (aside from API level), or image quality between the two?

How to&Answers:

Whenever you use SurfaceView to open camera, you can see a little lag and blink in screen. This is because, SurfaceView creates a new separate window where in TextureView (added in API level 14) does not create new window but acts as normal view, so, you won’t see any lag or blink while opening camera using TextureView.
This is more of a performance issue.

For more information, look here.