Physical ID Card Capture

The physical ID Capture introduces a way to capture photos of physical ID documents

Steps to implementation

Step 1

In your layout file add the SmartCardView. We advise on giving the view as much real estate as possible so match parent on both height and width is advisable

        <!--optional fields for customisation-->
        app:faceDetectedMessage="Custom face detected message"
        app:blurryMessage="Custom message for when capture is blurry"
        app:insufficientLightMessage="Custom message for when there is insufficient light"
        app:fitIdMessage="Custom message informing the user to fit the id on the rectangle and tap for focus"
        app:flashMissingErrorMessage="Custom flash missing error message"
        app:loadingMessage="Custom message for when ID capture is loading"
        app:detectingFaceMessage="Custom message for when ID capture face detection is in progress"
        app:noFaceDetectedMessage="Custom no face detected message"
        app:capturedBlurryMessage="Custom blurriness detected in captured image"
        app:capturedDarkMessage="Custom darkness detected in captured image"

Step 2

Initialize the view in your view controller as normal and set the listener so that the SDK can pass back information on the capture

SmartCardView smartCardView = findViewById(;

Step 3

Set your desired id type, this is an instance of IDType enum with options

  • Idcard => Aspect ratio 1.4 or normal credit card sized IDs

  • Passport => Aspect ratio 1.6 or normal passbort booklet sized IDs

  • Other => will default to 1.4 aspect ratio


Step 4

Start Capture, typically this should be called in your onResume so that the view maintains state with the implementing Activity/Fragment

protected void onResume() {
    try {
    } catch (SIDException e) {

The start capture method will display the view which should look like below

The method has a couple of possible errors that should be catered for this is important to make sure users get the best user experience and for handling possible failures gracefully.

  • //When camera initialisation fails
    //when no listener is set
    //When an empty or invalid tag is set
    //If your app does not have camera permissions
    //If the camera fails to process the captured image

Step 5

Implement pausing on the capture to handle view lifecycles

protected void onPause() {

Step 6

Error handling and callbacks from the ID Capture

public void onSmartCardViewError(Exception error) {
    //todo:handle this

public void onSmartCardViewComplete(Bitmap idCardBitmap, boolean faceFound) {
    //idCardBitmap the captured id card image
    //faceFound true if a face was found  on the ID 

public void onSmartCardViewClosed() {
  //User pressed X and the ID Card has been closed

ID Capture Custom Messaging

To enable customization and internationalization from version 7.1.0 the ID Capture allows messaging customization through out the whole capture process as demonstrated in step 1

Last updated