public static final enum PreviewView.ImplementationMode
extends Enum<PreviewView.ImplementationMode>

   ↳ java.lang.Enum<>

The implementation mode of a PreviewView.

User preference on how the PreviewView should render the preview. PreviewView displays the preview with either a SurfaceView or a TextureView. A SurfaceView is generally better than a TextureView when it comes to certain key metrics, including power and latency. On the other hand, TextureView is better supported by a wider range of devices. The option is used by PreviewView to decide what is the best internal implementation given the device capabilities and user configurations.


Enum values

PreviewView.ImplementationMode  COMPATIBLE

Use a TextureView for the preview. 

PreviewView.ImplementationMode  PERFORMANCE

Use a SurfaceView for the preview when possible. 

Public methods

static PreviewView.ImplementationMode valueOf(String name)
static final ImplementationMode[] values()

Inherited methods

Enum values


public static final PreviewView.ImplementationMode COMPATIBLE

Use a TextureView for the preview.


public static final PreviewView.ImplementationMode PERFORMANCE

Use a SurfaceView for the preview when possible. If the device doesn't support SurfaceView, PreviewView will fall back to use a TextureView instead.

PreviewView falls back to TextureView when the API level is 24 or lower, the camera hardware support level is CameraMetadata.INFO_SUPPORTED_HARDWARE_LEVEL_LEGACY, or Preview.getTargetRotation() is different from PreviewView's display rotation.

Do not use this mode if Preview.Builder.setTargetRotation(int) is set to a value different than the display's rotation, because SurfaceView does not support arbitrary rotations. Do not use this mode if the PreviewView needs to be animated. SurfaceView animation is not supported on API level 24 or lower. Also, for the preview's streaming state provided in PreviewView.getPreviewStreamState(), the PreviewView.StreamState.STREAMING state might happen prematurely if this mode is used.

Public methods


public static PreviewView.ImplementationMode valueOf (String name)

name String



public static final ImplementationMode[] values ()