tencent cloud

eKYC

Release Notes and Announcements
Release Notes
Product Announcements
Product Introduction
Overview
Strengths
Use Cases
Purchase Guide
Billing Overview
Purchase Method
Payment Overdue
Refund
Integration Guide
Getting Started
Selfie Verification (Pure API)
Selfie Verification (Mobile HTML5)
Selfie Verification (App SDK)
Identity Verification (Mobile HTML5)
Identity Verification (App SDK)
Other Guide
API Documentation
History
Introduction
API Category
Making API Requests
Selfie Verification (Pure API) APIs
Selfie Verification (App SDK) APIs
Identity Verification (App SDK) APIs
Identity Verification(Mobile HTML5) APIs
AI Face Shield (Pure API) APIs
Other APIs
Data Types
Error Codes
FAQs
Contact Us
Glossary
eKYC Policy
Privacy Policy
Data Processing And Security Agreement
Service Level Agreement

APIs for Android

PDF
Focus Mode
Font Size
Last updated: 2026-03-27 11:16:18
The classes involved in the Android Identity Verification SDK primarily include EkycHySdk, EkycHyConfig, and EkycHyCallBack. Detailed descriptions of their supported APIs are provided below.


EkycHySdk

The EkycHySdk serves as the external API class for the Identity Verification SDK, with core functionalities primarily accomplished by invoking this class.
API
Feature Description
Initialization APIs
Releases resources.
Start the entire Identity Verification process.
Set the event callback during the Selfie Verification process.
Set the event callback during the OCR process.

init()

public static void init(Context context)

Feature Introduction:
The initialization API for the Identity Verification SDK.

Input Parameters:
Parameter Type
Parameter Name
Parameter Description
Context
context
App context information

release()

public static void release()

Feature Introduction:
The resource release API for the Identity Verification SDK.


startEkycCheck()

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

Feature Introduction:
The function to initiate the Identity Verification process.

Parameters:
Parameter Type
Parameter Name
Parameter Description
String
ekycToken
The Token value obtained from the server, serving as the unique business credential for this process.
ekycHyConfig
Configuration information for initiating the Identity Verification process.
ekycHyCallBack
API for receiving authentication result callbacks

setAuthEventCallBack()

public static void setAuthEventCallBack(HuiYanAuthEventCallBack authEventCallBack)

Feature Introduction:
Setting the event callback during the Selfie Verification process, which can be used to monitor the verification page lifecycle and key events during detection.

Parameters:
Parameter Type
Parameter Name
Parameter Description
HuiYanAuthEventCallBack
authEventCallBack
Event callback API for Selfie Verification
HuiYanAuthEventCallBack callback methods:
Methodology
Description
onMainViewCreate(View)
Callback upon creation of the Selfie Verification main page.
onMainViewDestroy()
Callback upon destruction of the Selfie Verification main page.

setOcrEventCallBack()

public static void setOcrEventCallBack(OcrEventListener ocrEventListener)

Feature Introduction:
Set event callbacks during the OCR process to monitor the OCR page lifecycle and camera status.

Parameters:
Parameter Type
Parameter Name
Parameter Description
OcrEventListener
ocrEventListener
OCR Event Callback API
OcrEventListener main callback methods:
Methodology
Description
onMainViewCreate(View)
Callback upon creation of the OCR main page.
onMainViewDestroy()
Callback upon destruction of the OCR main page.

EkycHyConfig

EkycHyConfig is the configuration entity class for initializing the Identity Verification SDK, mainly containing the following attributes.
Type
Name
Meaning
Default Value
String
licenseName
Customer's user authorization License file name
Null
String
riskLicenseName
Added license configuration for device risk detection. This must be configured when openCheckRiskMode is set to true.
Null
boolean
openCheckRiskMode
Whether to enable device risk detection: when the input parameter SdkVersion in ApplySdkVerificationToken is set to ENHANCE or PLUS, it must be configured as enabled (true).
false
int
ocrAutoTimeout
Timeout for automatic capture in OCR_DETECT_AUTO_MANUAL mode (in milliseconds, minimum setting: 5000 ms, internal upper limit: 30000 ms)
20000 milliseconds (20 seconds)
languageStyle
Language style of the current process
LanguageStyle.AUTO
String
languageCode
Language code, used in conjunction with LanguageStyle.CUSTOMIZE_LANGUAGE.
Null
long
livenessAutoTimeout
The timeout for selfie verification.
30000 milliseconds (30 seconds), supporting a range of 10 seconds minimum to 600 seconds maximum.
boolean
showPrivacyPolicyDialog
Whether to display the privacy policy dialog
true
boolean
isUseBackCameraOnFaceAuth
Whether to use the rear camera for selfie verification. If light-based liveness detection is enabled, enabling this option will report error 12008.
false
String
ocrModelPath
OCR model file path. When the OcrSDK-common-model AAR is not imported, this field must be used to specify the external model file path (file name is subject.iap).
Null
String
faceModelPath
Selfie verification model directory path. When the huiyanmodels AAR is not imported, this field must be used to specify the external model directory path (directory name is face-tracker-v003).
Null
ocrUiConfig
Custom UI configuration for the OCR interface
null
faceAuthUiConfig
Custom UI configuration for the liveness face verification page
null

OcrUiConfig

Custom UI configuration for the OCR interface, passed in via EkycHyConfig.setOcrUiConfig().

Method name
Parameter Type
Meaning
Default Value
portraitLayoutResId
int
Portrait layout resource ID
-2
portraitThemeResId
int
Portrait theme style resource ID
-2
showStatusBar
boolean
Whether to display the status bar
true
statusBarColor
int
Status bar background color (in 0xFFFFFF format)
-2
useDeepColorStatusBarIcon
boolean
Whether to use dark icons for the status bar (to be used with a light-colored status bar)
false
cardFrameDefaultColor
int
Default state color for the card border (when no card is detected)
-2
cardFrameColor
int
Highlight state color for the card border (when recognition is successful)
-2
warnErrorTextColor
int
Error state color for the card border and error prompt text color
-2
defaultTipTextColor
int
Prompt text color in the card frame area under default state
-2
successRemindTextColor
int
Prompt text color in the card frame area under successful recognition state
-2
imageSelectResId
int
Album local image selection button icon resource ID
-2
lightImageOnResId
int
Flashlight on button icon resource ID
-2
lightImageOffResId
int
Close flashlight button icon resource ID
-2
takePicturesResId
int
Manual capture button icon resource ID
-2
backActionIconResId
int
Back button icon resource ID
-2
removeAlbum
boolean
Whether to hide the album image selection feature
false
removeFlash
boolean
Whether to hide the flashlight button
false
isShowIdcardLogo
boolean
Whether the ID card scanning frame displays the photo/national emblem Logo
true
remindDialogText
String
Reminder Dialog text content
""
remindDialogTextColor
int
Reminder Dialog text color
-2
remindDialogTextSize
int
Reminder Dialog text size
-2
remindDialogConfirmText
String
Confirm button text
""
remindDialogCancelText
String
Cancel button text
""
remindDialogConfirmColor
int
Confirm button color
-2
remindDialogCancelColor
int
Cancel button color
-2
remindDialogShowTitle
boolean
Whether to display the title of the Reminder Dialog
true
remindDialogCommonStyle
int
Reminder Dialog overall style Resource ID
-2
remindDialogCommonBgColor
int
Reminder Dialog background color
-2
remindDialogChangeModeTextOnLeft
boolean
Whether the mode toggle button is displayed on the left side of the Dialog
false
Note:
Default value -2 indicates that this field is not set, and the SDK uses the built-in default value.

FaceAuthUiConfig

Custom UI configuration for the liveness face verification page, passed in via EkycHyConfig.setFaceAuthUiConfig().
Method name
Parameter Type
Meaning
Default Value
authLayoutResId
int
Portrait identity verification page custom layout ResId
-2
mainActivityThemeId
int
Identity verification Activity theme ResId
-2
statusBarColor
int
Status bar color (in 0xFFFFFF format)
-2
isTransparentStatusBar
boolean
Whether the status bar is transparent
false
transparentStatusBarMoveHeight
int
Height of content shift when the status bar is transparent (px)
-2
useDeepColorStatusBarIcon
boolean
Whether the status bar icons use dark color
false
isShowCountdown
boolean
Whether to display the countdown
true
isShowErrorDialog
boolean
Whether to display error pop-ups
true
countDownTxtColor
int
Countdown text color
-2
cancelTxtColor
int
Cancel button text color
-2
feedBackTxtColor
int
Detection feedback prompt text color (normal state)
-2
feedBackErrorColor
int
Detection feedback error state color
-2
feedBackExtraTipColor
int
Detection feedback additional prompt text color
-2
authCircleCorrectColor
int
Face circular frame color when actions are correct
-2
authCircleErrorColor
int
Face circular frame color when actions are incorrect
-2
isHideFrontCircleViewOnStart
boolean
Whether to hide the face circle during the startup phase
false
isHideFrontCircleViewOnCheck
boolean
Whether to hide the face circle during the action detection phase
false
isHideFrontCircleViewOnReflect
boolean
Whether to hide the face circle during the reflection phase
false
isHideAvatarGuideFrame
boolean
Whether to hide the avatar guidance box
false
authLayoutBgColor
int
Verification page background color
-2
loadingStageBgColor
int
Loading phase background color
-2
loadingStageTipsColor
int
Loading phase prompt text color
-2
Note:
Default value -2 indicates that this field is not set, and the SDK uses the built-in default value.

LanguageStyle

Multilingual configuration for the default page of Identity Verification.
LanguageStyle type
Description
LanguageStyle.AUTO
Auto
LanguageStyle.ENGLISH
English
LanguageStyle.SIMPLIFIED_CHINESE
Simplified Chinese
LanguageStyle.TRADITIONAL_CHINESE
Traditional Chinese
LanguageStyle.CUSTOMIZE_LANGUAGE
Custom language, must be used with languageCode. For details, see Android Customization Capabilities

EkycHyCallBack

A listener class for receiving the results of the Identity Verification process.
/**
* Result callback class for Card and Liveness Face Comparison
*/
public interface EkycHyCallBack {

/**
* Information about the successful recognition result
*
* @param result Result information.
*/
void onSuccess(EkycHyResult result);

/**
* Failure details of the Card and Liveness Face Comparison process
*
* @param errorCode Error code.
* @param errorMsg Error message.
* @param ekycToken token for the current process
*/
void onFail(int errorCode, String errorMsg, String ekycToken);
}
where EkycHyResult is the successfully returned result object.


EkycHyResult

The EkycHyResult is the result object returned upon successful completion of the Identity Verification SDK process.
Type
Name
Meaning
Default Value
String
ekycToken
The token for the current Identity Verification process, which can be used to retrieve key data from the identity verification process on the server.
Null

Error Code

Error Code
Corresponding meaning
12000
It is voluntarily canceled by user
12001
Network request failure
12002
Error caused by OCR recognition exception
12003
Exception caused by on-device face detection failure
12004
Expired token
12005
On-device document recognition failure
12006
Failure in the initialization process of the Identity Verification SDK
12007
Startup parameter validation failure
12008
Failure in the return of selfie verification results
12009
Failure in the on-device selfie verification process

Help and Support

Was this page helpful?

Help us improve! Rate your documentation experience in 5 mins.

Feedback