tencent cloud

APIs for Android

Download
Modo Foco
Tamanho da Fonte
Última atualização: 2026-04-30 15:20:41
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

EkycHySdk is the external API class for the Identity Verification SDK, and the main logic is implemented by calling this class.
API
Feature Description
Initialization APIs
Resource Release API
Start the Identity Verification detection process.
Set the event callback during the Selfie Verification process.
Set the event callback during the OCR document recognition process.

init()

public static void init(Context context)

Feature Introduction:
Identity Verification SDK's initialization API.

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

release()

public static void release()

Feature Introduction:
Identity Verification SDK resource release API.


startEkycCheck()

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

Feature Introduction:
Function to initiate the Identity Verification process.

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

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
Meaning
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
Meaning
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-authorized License file name
Null
String
riskLicenseName
Added license configuration for device risk detection; required 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
In OCR_DETECT_AUTO_MANUAL mode, the timeout duration for automatic capture (in milliseconds, minimum 5000ms/5s, maximum 30000ms/30s).
20000 milliseconds (20 seconds)
languageStyle
Language for 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), supported range: minimum 10 seconds, maximum 600 seconds.
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 will throw 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
boolean
isShowGuidePage
Whether to display the preparation guide page before Face Recognition. When set to false, the SDK skips the guide page and directly goes to liveness detection.
true
boolean
isShowResultPage
Whether to display the result page after Face Recognition. When set to false, the SDK skips the result page and directly returns the result to the host app via callback.
true
boolean
isEntireHighlight
The Face Recognition page remains highlighted throughout the process when set to true.
false
ocrUiConfig
Custom UI configuration for the OCR recognition interface
null
faceAuthUiConfig
Custom UI configuration for the selfie verification page
null

OcrUiConfig

Custom UI configuration for the OCR recognition page, set 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 status bar icons (for use with light-colored status bars)
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 for the card frame area in default state
-2
successRemindTextColor
int
Prompt text color for the card frame area in recognition success state
-2
imageSelectResId
int
Album local image selection button icon resource ID
-2
lightImageOnResId
int
Flashlight activation button icon resource ID
-2
lightImageOffResId
int
Flashlight deactivation 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 gallery image selection feature
false
removeFlash
boolean
Whether to hide the flashlight button
false
isShowIdcardLogo
boolean
Whether to display the portrait/national emblem Logo in the ID card scanning frame
true
remindDialogText
String
Alert Dialog text content
""
remindDialogTextColor
int
Alert Dialog text color
-2
remindDialogTextSize
int
Alert 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 Alert Dialog
true
remindDialogCommonStyle
int
Alert Dialog overall style resource ID
-2
remindDialogCommonBgColor
int
Alert Dialog background color
-2
remindDialogChangeModeTextOnLeft
boolean
Whether to display the mode switch button 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 Identity Verification page, passed in via EkycHyConfig.setFaceAuthUiConfig().
Method name
Parameter Type
Meaning
Default Value
authLayoutResId
int
Portrait verification page custom layout ResId
-2
mainActivityThemeId
int
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
Content shift-up height (px) when status bar is transparent
-2
useDeepColorStatusBarIcon
boolean
Whether dark-colored status bar icons are used
false
isShowCountdown
boolean
Whether to display the countdown timer
true
isShowErrorDialog
boolean
Whether to display the error dialog.
true
countDownTxtColor
int
Countdown text color
-2
cancelTxtColor
int
Cancel button text color
-2
feedBackTxtColor
int
Feedback prompt text color for detection (normal state)
-2
feedBackErrorColor
int
Error state color for detection feedback
-2
feedBackExtraTipColor
int
Additional prompt text color for detection feedback
-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 circular frame during startup
false
isHideFrontCircleViewOnCheck
boolean
Whether to hide the face circular frame during the action detection phase
false
isHideFrontCircleViewOnReflect
boolean
Whether to hide the face circular frame during the liveness detection phase
false
isHideAvatarGuideFrame
boolean
Whether to hide the avatar guidance box
false
authLayoutBgColor
int
Identity 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
Meaning
LanguageStyle.AUTO
Follow the system language version
LanguageStyle.ENGLISH
English
LanguageStyle.SIMPLIFIED_CHINESE
Simplified Chinese
LanguageStyle.TRADITIONAL_CHINESE
Traditional Chinese
LanguageStyle.CUSTOMIZE_LANGUAGE
Custom language, must be used in conjunction with languageCode. For details, see Android custom 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
Meaning
12000
Voluntary cancellation by the user
12001
Network request failure.
12002
Error caused by OCR recognition exception.
12003
Exception caused by on-device face detection failure.
12004
Invalid token.
12005
On-device document recognition failure
12006
Failure of the Identity Verification SDK initialization process.
12007
Startup parameter validation failure.
12008
Failure in the return of selfie verification results
12009
Failure in the on-device selfie verification process

Ajuda e Suporte

Esta página foi útil?

comentários