LogoLogo
  • Welcome!
  • GETTING STARTED
    • Signing Up
    • Choose a Product
    • Choose an Integration Option
    • Run Your First Test Job
    • Complete Your KYC
    • Fund Your Wallet
    • Go Live!
    • Pricing
  • SUPPORTED ID TYPES & DOCUMENTS
    • For Individuals (KYC)
      • Using ID Number
        • Supported Countries
          • Côte d'Ivoire
            • National ID (without Photo)
            • Resident ID (without Photo)
          • Ghana
            • Ghana Card
            • Passport
            • Voter's ID
          • Kenya
            • Alien Card
            • KRA Pin
            • National ID
            • National ID (without Photo)
            • Passport
            • Tax Information
          • Nigeria
            • Bank Account
            • BVN
            • NIN V2
            • NIN Slip Verification
            • V_NIN (Virtual NIN)
            • Phone Number
            • Voter's ID
          • South Africa
            • National ID
            • National ID (without Photo)
            • Phone Number
          • Uganda
            • National ID (without Photo)
            • Basic KYC in Uganda
          • Zambia
            • Bank Account
            • TPIN
          • Zimbabwe
            • National ID (without Photo)
        • Test Data
          • Customising Sandbox Test Data
        • ID Number Regex
        • Visual Samples of Supported ID Types
      • Using Document Image
        • Continents
          • Africa
          • Asia and the Middle East
          • Europe
          • North America
          • Oceania
          • South America
    • For Businesses (KYB)
      • Supported Countries
        • Nigeria
          • Business Registration
          • Tax Information
        • Kenya
          • Business Registration
        • South Africa
          • Business Registration
      • ID Number Regex
  • PRODUCTS
    • For Individuals (KYC)
      • AML Check
        • AML News Media
      • Basic KYC
      • Biometric KYC
      • Digital Address Verification
      • Document Verification
        • Document Verification
        • Enhanced Document Verification
      • Electronic Signature
      • Enhanced KYC
      • Phone Number Verification
      • SmartSelfie™ Authentication
      • SmartSelfie™ Compare
      • Smile Secure
    • For Businesses (KYB)
      • Business Verification
  • Integration Options
    • Mobile
      • Getting Started
      • Products
        • Biometric KYC
        • BVN Consent
        • Document Verification
        • Enhanced Document Verification
        • Enhanced KYC
        • SmartSelfie™ Enrollment and Authentication
        • Enhanced SmartSelfie™ Enrollment And Authentication
      • Customization
        • UI Components
      • Offline Mode
      • Release Notes
        • Android Release Notes
        • iOS Release Notes
        • Flutter Release Notes
        • React Native Release Notes
    • No-Code
      • Smile Links
        • Link FAQs
        • Rest API
    • Server to Server
      • Ruby
        • Installation
        • Signature
        • Products
          • Basic KYC
          • Enhanced KYC
          • Biometric KYC
          • Document Verification
          • SmartSelfie™ Authentication
          • KYB - Business Verification
          • AML Check
        • Generate Token for Web Integration
        • Utilities
      • Python
        • Installation
        • Signature
        • Products
          • Basic KYC
          • Enhanced KYC
          • Biometric KYC
          • Document Verification
          • SmartSelfie™ Authentication
          • Business Verification
        • Generate Token for Web Integration
        • Utilities
      • Java
        • Release Notes
        • Installation
        • Signature
        • Products
          • Basic KYC
          • Enhanced KYC
          • Biometric KYC
          • Document Verification
          • SmartSelfie™ Authentication
        • Generate Token for Web Integration
        • Utilities
      • Node.js
        • Installation
        • Signature
        • Products
          • Basic KYC
          • Enhanced KYC
          • Biometric KYC
          • Document Verification
          • Enhanced Document Verification
          • SmartSelfie™ Authentication
          • Business Verification
        • Generate Token for Web Integration
        • Utilities
      • PHP
        • Installation
        • Signature
        • Products
          • Basic KYC
          • Enhanced KYC
          • Biometric KYC
          • Document Verification
          • SmartSelfie™ Authentication
        • Generate Token for Web Integration
        • Utilities
    • Rest API
      • Signing your API Request
        • Using Signature
      • Products
      • Postman Collection
      • Utilities
    • Web / Mobile Web
      • Web Integration
        • Installation
        • Usage
        • End User Consent
        • Support
      • Javascript SDK
        • Installation
        • Usage
        • Migration
        • Deprecated Version
          • Installation
          • Usage
          • Notes
          • Support
  • FURTHER READING
    • FAQs
      • What are your support hours?
      • How do I set up a callback?
      • How to re-enroll, deactivate or delete a user?
      • Add or remove team members
      • What are top-level keys?
      • What are partner_params?
      • How do job types map to the new product names?
      • Is there an API I can use to monitor my wallet balance?
      • Is there an API I can query to check the availability status of an ID type?
      • How do I integrate Smile ID in other countries or query other ID types?
      • What are the image types I can upload to Smile ID?
      • Why aren't Kenyan IDs returning images for some IDs queried?
      • Why are some of my bank verification requests returning 'ID authority unavailable'?
      • How can I look up a specific user's data?
      • Selfie best-practices
      • Document capture best-practices
      • What happens under the hood?
      • Guide to the user consent screen
      • What is code 2302?
      • Using the Demo App and Scanning QR codes
    • Job status
    • KYC receipts
    • Result codes
      • Error codes
    • Securing your account with two-factor authentication (2FA)
    • Security Overview
    • Troubleshooting
      • Troubleshooting error 2204 & 2205 - "You're not authorized to do that"
      • Why is my Web API job taking so long?
      • Image capture issues on web client
Powered by GitBook
On this page
  • Steps to implementation
  • Step 1
  • Step 2
  • Step 3
  • Step 4
  • Step 5
  • Step 6
  • ID Capture Custom Messaging

Was this helpful?

  1. Integration Options
  2. Mobile
  3. Android v7 (deprecated)
  4. Smile ID SDK

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

<com.smileidentity.libsmileid.core.idcapture.SmartCardView
        android:id="@+id/id_capture"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        <!--optional fields for customisation-->
        xmlns:app="http://schemas.android.com/apk/res-auto"
        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"
        >
 </com.smileidentity.libsmileid.core.idcapture.SmartCardView>

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(R.id.id_capture);
smartCardView.setListener(this);

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

smartCardView.setIdType(<IdType>);

Step 4

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

@Override
protected void onResume() {
    super.onResume();
    try {
        mSmartCardView.startCapture(mCurrentTag);
    } catch (SIDException e) {
        e.printStackTrace();
    }
}

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
    SIDError.COULD_NOT_INITIALIZE_CAMERA
    
    //when no listener is set
    SIDError.MISSING_LISTENER
    
    //When an empty or invalid tag is set
    SIDError.INVALID_TAG_FORMAT
    
    //If your app does not have camera permissions
    SIDError.PERMISSION_ERROR
    
    //If the camera fails to process the captured image
    SIDError.ID_CARD_PICTURE_CALLBACK_FAILED

Step 5

Implement pausing on the capture to handle view lifecycles

@Override
protected void onPause() {
    super.onPause();
    mSmartCardView.pauseCapture();
}

Step 6

Error handling and callbacks from the ID Capture

�

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

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

@Override
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 11 months ago

Was this helpful?