tencent cloud


APIs for Android

Last updated: 2022-07-28 14:47:15

    The main API classes used in the eKYC SDK for Android are EkycHySdk, EkycHyConfig, and EkycHyCallBack. Specific APIs in these classes are described as below.


    EkycHySdk is a class of external APIs for the eKYC SDK. Main logic operations are completed with this class.

    API Feature Description
    init() Initializes the eKYC SDK
    release() Releases resources
    startEkycCheck() Starts the eKYC process


    public static void init(Context context)


    It is an API for initializing the ​eKYC SDK.

    Input parameters:

    Parameter Type Parameter Name Description
    context Context Context of the app


    public static void release() 


    It is an API for releasing eKYC SDK resources.


    public static void startEkycCheck(final String ekycToken, EkycHyConfig ekycHyConfig,
              EkycHyCallBack ekycHyCallBack)


    It is a function for starting the eKYC process.

    Input parameters:

    Parameter Type Parameter Name Description
    String ekycToken The token obtained from the server, which is used as the unique credential for this process.
    EkycHyConfig ekycHyConfig Configuration info for this eKYC process startup
    EkycHyCallBack ekycHyCallBack API for receiving the verification result callback


    EkycHyConfig is the configuration entity class used during the eKYC SDK startup, which mainly covers the following attributes:

    Type Name Description Default Value
    OcrUiConfig ocrUiConfig Custom configurations on the OCR interface Null
    String licenseName Name of the license file requested for user identity verification Null
    int verAutoTimeOut Timeout period of card and certificate authentication 20,000 ms (20s)
    int hyFaceTimeOut Timeout period of a single face authentication operation 10,000 ms (10s)
    LanguageStyle languageStyle Language style of this process LanguageStyle.AUTO


    This API is used to detect the type of the document.
    | Enumerated Value | Description |
    |HK| Hong Kong (China) - identity card |
    |ML| Malaysia - identity card |
    |PhilippinesDrivingLicense| Philippines - driver's license |
    |PhilippinesVoteID| Philippines - VoteID |


    This API provides the language configuration information of the default eKYC interface.

    LanguageStyle Description
    LanguageStyle.AUTO Auto
    LanguageStyle.ENGLISH English
    LanguageStyle.SIMPLIFIED_CHINESE Simplified Chinese
    LanguageStyle.TRADITIONAL_CHINESE Traditional Chinese


    Type Name Description Default Value
    boolean isRemoveAlbum Whether to hide the album button on the OCR interface false
    boolean isRemoveFlash Whether to hide the flash button on the OCR interface false


    This is the listener class for receiving the eKYC process results.

    * The result callback class for eKYC
    public interface EkycHyCallBack {
       * Result information on successful recognition
       * @param result: Result data
      void onSuccess(EkycHyResult result);
       * Information of eKYC process failure
       * @param errorCode: Error code
       @param errorMsg: Error message
       * @param ekycToken: The token of this process
      void onFail(int errorCode, String errorMsg, String ekycToken);

    Here EkycHyResult is the result object returned after a successful process.


    EkycHyResult is the result object returned after the eKYC process succeeds.

    Type Name Description Default Value
    String ekycToken The token of this eKYC process, which can be used to pull key data of the eKYC process from the server. Null

    Error codes and descriptions

    Error Code Description
    12000 The user canceled the operation
    12001 The network request failed
    12002 Error caused by OCR recognition exception
    12003 Exception caused by local face authentication failure
    12004 Invalid token
    12005 Failed to perform local card and certificate authentication
    12006 Failed to initialize the eKYC SDK
    12007 Failed to start parameter verification
    12008 Failed to return the face authentication result
    12009 Failed to perform the local face authentication
    Contact Us

    Contact our sales team or business advisors to help your business.

    Technical Support

    Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

    7x24 Phone Support