How to Implement One-Page Image Capture with User Interface

 Note: Before you begin, see Build your application with the library for Android.

Below you can find description of a basic image capture scenario with user interface components.

  1. Before you start, add the CaptureView class to the XML layout of your Activity or Fragment with default parameters. If you are implementing a non-English app, you can override the string resources of the user interface, using the attributes' IDs (see CaptureView attributes for details).
  2. Receive the CaptureView class object from your layout inside the onCreate Activity or onViewCreated Fragment.
  3. Override the onResume and onPause methods, embedding the UI components methods:
  4. Call the Engine.load method on the UI thread to create an engine object, required for all recognition mechanisms to work. This object should be reused for every new operation and should not be created again in the same activity.
  5. Create the ImageCaptureScenario object, passing the created Engine object to its constructor, to connect the user interface and recognition parts.
  6. Implement the Callback interface. Create the Callback object with the ImageCaptureScenario.setCallback method. The methods of the callback will be used to get the result and monitor errors. Here are brief recommendations on what the methods should do:
  7. Use the CaptureView.setCaptureScenario method to set the capture scenario.
     Note: Currently only Mobile Imaging scenario is supported.
  8. Start performing the scenario with the start method of the ImageCaptureScenario object.
  9. Wait for the response or an error in the callback.

See the description of classes and methods in the User Interface API Reference section.

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.