CaptureView class

Displays camera preview and provides methods for tuning the user interface appearance and parameters of the capture process. This class configures all capture scenarios.

Extends the FrameLayout class.

If you're using CaptureView class within an Android Fragment, you should close this Fragment with a back stack name, because the capture scenario may also show Fragments. Checkout the sample below.

The sample

 Note: CameraSettings, UISettings and ExtendedSettings set values will be discarded on the CaptureView object's recreation.

class CaptureView{
   public class CaptureView( Context context )
   public class CaptureView( Context context, AttributeSet attrs )
   public class CaptureView( Context context, AttributeSet attrs, Int defStyleAttr )
   public class CaptureView( Context context, AttributeSet attrs, Int defStyleAttr, Int defStyleRes )

The CaptureView class constructor throws an exception when the appCompatDependency dependency is not set. See the How to Add the Library to Your Android Studio Project to find the dependency definition.


 Important! All methods should be called from the Android Main Thread.

Name Description
startCamera Starts working with the camera.
setCaptureScenario Defines and automatically starts capture scenario, represented by a CaptureScenario object.
stopCamera Stops working with the camera.
showInfoTip Displays the specified string tip during a time period.
getCameraSettings Returns the CameraSettings object that provides access to the camera settings.
getExtendedSettings Returns the ExtendedSettings object with settings for non-common scenarios.
getUISettings Returns the UISettings object that defines the settings of the user interface.


The user interface messages can be adjusted using attributes of your XML layout.

To the CaptureView tag of the XML layout add the following code:

android:layout_height="match_parent" />

To the CaptureViewLocalization style tag of your values.xml or styles.xml file add the source strings identifiers and edit them as needed.

Source strings identifiers to be added

02.03.2022 12:59:15

Usage of Cookies. In order to optimize the website functionality and improve your online experience ABBYY uses cookies. You agree to the usage of cookies when you continue using this site. Further details can be found in our Privacy Notice.