Package com.regula.facesdk
Class FaceSDK
java.lang.Object
BaseRegulaSDK
com.regula.facesdk.FaceSDK
public final class FaceSDK
extends BaseRegulaSDK
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected CaptureProcessprotected Customizationprotected final Stringprotected FaceCaptureCallbackprotected booleanprotected booleanprotected FaceCaptureNotificationCallbackprotected LivenessCallbackprotected LivenessNotificationCallbackprotected View.OnClickListenerprotected Stringprotected Stringprotected FaceSDKVersionprotected WeakReference<IVideoEncoderCompletion> -
Method Summary
Modifier and TypeMethodDescriptionprotected voidbooleandeinit()Deprecated.booleanMethod to deinitialize FaceSDK corevoiddetectFaces(Context context, DetectFacesRequest request, DetectFacesCompletion completion) Create request to detect faces and check face image qualityseeCustomizationdescriptiongetEnv()Deprecated.protected StringGetting url of the servicevoidinit(Context context, FaceInitializationCompletion initCallback) Deprecated.protected voidinitApplicationPath(Context context) voidinitialize(Context context, FaceInitializationCompletion initCallback) Prepares Face Recognition SDK to work, usevoidinitialize(Context context, InitializationBleDeviceConfiguration initConfig, FaceInitializationCompletion initCallback) Prepares Face Recognition SDK with initialization parameters from BLE devicevoidinitialize(Context context, InitializationConfiguration initConfig, FaceInitializationCompletion initCallback) Prepares Face Recognition SDK to work with licenseprotected voidinitSdk(Context context, LicenseConfig initConfig, FaceInitializationCompletion initCallback) static FaceSDKInstance()A shared instance of the FaceSDKbooleanMethod returns state of FaceSDK corevoidmatchFaces(Context context, MatchFacesRequest request, MatchFaceCallback completion) Create match faces request for matching input on the similarity.voidmatchFaces(Context context, MatchFacesRequest request, MatchFacesConfiguration configuration, MatchFaceCallback completion) Creates match faces request to match input on the similaritypersonDatabase(Context context) voidpresentFaceCaptureActivity(Context context, FaceCaptureCallback completion) Start the face capture activityvoidpresentFaceCaptureActivity(Context context, FaceCaptureCallback completion, FaceCaptureNotificationCallback callback) Start the face capture activityvoidpresentFaceCaptureActivity(Context context, FaceCaptureConfiguration configuration, FaceCaptureCallback completion) Start the FaceCaptureActivityvoidpresentFaceCaptureActivity(Context context, FaceCaptureConfiguration configuration, FaceCaptureCallback completion, FaceCaptureNotificationCallback callback) Start the FaceCaptureActivityvoidvoidvoidsetLogs(boolean isEnable) Enable API logsvoidsetLogsFolder(String path) Set path to log filevoidsetNetworkInterceptorListener(NetworkInterceptorListener networkInterceptorListener) set listener to intercept any http request from FaceSDKvoidsetOnClickListener(View.OnClickListener onClickListener) Set click listener for buttons from the UI customization layervoidsetSaveLogs(boolean isSaveLog) Enable saving API logs to filevoidsetServiceUrl(String url) Set the URL of your service.voidvoidsetVideoEncoderCompletion(IVideoEncoderCompletion videoCompletedListener) set listener to finish uploading liveness videovoidstartLiveness(Context context, LivenessCallback completion) Start liveness processvoidstartLiveness(Context context, LivenessCallback completion, LivenessNotificationCallback callback) Start liveness processvoidstartLiveness(Context context, LivenessConfiguration configuration, LivenessCallback completion) Start liveness activityvoidstartLiveness(Context context, LivenessConfiguration configuration, LivenessCallback completion, LivenessNotificationCallback notification) Start liveness activityprotected voidstartLogHandler(String transactionId) voidstopFaceCaptureActivity(Context context) Stop the face capturing and close finish FaceCaptureActivity by contextvoidstopLivenessProcessing(Context context) Stop the liveness processing and activity by context
-
Field Details
-
defaultUrl
- See Also:
-
serviceUrl
-
isFaceDetecting
protected boolean isFaceDetecting -
faceCaptureCallback
-
mLivenessCallback
-
mNotificationCallback
-
mFaceCaptureNotificationCallback
-
isInitialized
protected boolean isInitialized -
videoEncoderCompletion
-
customization
-
onClickListener
protected View.OnClickListener onClickListener -
sessionPath
-
version
-
captureProcess
protected CaptureProcess captureProcess
-
-
Method Details
-
Instance
A shared instance of the FaceSDK- Returns:
- return instance of the
FaceSDKclass
-
init
Deprecated.Prepares Face Recognition SDK to work, useinitialize(Context, FaceInitializationCompletion)instead- Parameters:
context- Application's context- Since:
- 6.1
-
initialize
Prepares Face Recognition SDK to work, use- Parameters:
context- Application's context
-
initialize
public void initialize(Context context, InitializationConfiguration initConfig, FaceInitializationCompletion initCallback) Prepares Face Recognition SDK to work with license- Parameters:
context- Application's context
-
initialize
public void initialize(Context context, InitializationBleDeviceConfiguration initConfig, FaceInitializationCompletion initCallback) Prepares Face Recognition SDK with initialization parameters from BLE device- Parameters:
context- Application's context
-
deinit
Deprecated.Method to deinitialize FaceSDK core, usedeinitialize()instead- Returns:
- true when deinit was success
- Since:
- 6.1
-
deinitialize
public boolean deinitialize()Method to deinitialize FaceSDK core- Returns:
- true when deinitialize was success
-
personDatabase
-
setServiceUrl
Set the URL of your service. -
getServiceUrl
Getting url of the service- Returns:
- An URL of your service in the
Stringformat.
-
matchFaces
Create match faces request for matching input on the similarity.- Parameters:
context- Application's contextrequest-MatchFacesRequestMatch faces request.completion-MatchFaceCallbackthe block to execute after the presentation finishes.
-
matchFaces
public void matchFaces(Context context, MatchFacesRequest request, MatchFacesConfiguration configuration, MatchFaceCallback completion) Creates match faces request to match input on the similarity- Parameters:
context- Application's contextrequest- Match faces requestconfiguration- FaceCaptureConfiguration the configuration information.completion- MatchFaceCallback The block to execute after the presentation finishes.
-
presentFaceCaptureActivity
Start the face capture activity- Parameters:
context- Application's contextcompletion-FaceCaptureCallbackcallback that execute after the face capturing process is finished
-
presentFaceCaptureActivity
public void presentFaceCaptureActivity(Context context, FaceCaptureCallback completion, FaceCaptureNotificationCallback callback) Start the face capture activity- Parameters:
context- Application's contextcompletion-FaceCaptureCallbackcallback that execute after the face capturing process is finished
-
presentFaceCaptureActivity
public void presentFaceCaptureActivity(Context context, FaceCaptureConfiguration configuration, FaceCaptureCallback completion) Start the FaceCaptureActivity- Parameters:
context- Application's contextconfiguration- provide configuration information (flags, cameraId and headers)completion- presentation of the FaceCaptureActivity callback
-
presentFaceCaptureActivity
public void presentFaceCaptureActivity(Context context, FaceCaptureConfiguration configuration, FaceCaptureCallback completion, FaceCaptureNotificationCallback callback) Start the FaceCaptureActivity- Parameters:
context- Application's contextconfiguration- provide configuration information (flags, cameraId and headers)completion- presentation of the FaceCaptureActivity callbackcallback-ICameraSwitchCallbackcallback that receiving event of switch camera by an user
-
startLiveness
Start liveness process- Parameters:
context- Application's contextcompletion-LivenessCallbackthe block to execute after the onLivenessCompete finishes.
-
startLiveness
public void startLiveness(Context context, LivenessConfiguration configuration, LivenessCallback completion) Start liveness activity- Parameters:
context- Application's contextconfiguration-LivenessConfigurationprovide configuration informationcompletion-LivenessCallbackliveness ending callback
-
startLiveness
public void startLiveness(Context context, LivenessCallback completion, LivenessNotificationCallback callback) Start liveness process- Parameters:
context- Application's contextcompletion-LivenessCallbackthe block to execute after the onLivenessCompete finishes.callback-ICameraSwitchCallbackcallback that receiving event of switch camera by an user
-
startLiveness
public void startLiveness(Context context, LivenessConfiguration configuration, LivenessCallback completion, LivenessNotificationCallback notification) Start liveness activity- Parameters:
context- Application's contextconfiguration-LivenessConfigurationprovide configuration informationcompletion-LivenessCallbackliveness ending callbacknotification-NotificationCallbackliveness notification callback
-
stopFaceCaptureActivity
public void stopFaceCaptureActivity(Context context) Stop the face capturing and close finish FaceCaptureActivity by context- Parameters:
context- Application's context
-
stopLivenessProcessing
public void stopLivenessProcessing(Context context) Stop the liveness processing and activity by context- Parameters:
context- Application's context
-
getFaceSdkVersion
Deprecated.Get the faceSdk version- Returns:
- faceSdk module version in the
Stringformat usegetVersion()
-
setNetworkInterceptorListener
set listener to intercept any http request from FaceSDK- Parameters:
networkInterceptorListener-NetworkInterceptorListenerlistener
-
setVideoEncoderCompletion
set listener to finish uploading liveness video- Parameters:
videoCompletedListener-IVideoEncoderCompletionlistener
-
getCustomization
seeCustomizationdescription -
detectFaces
public void detectFaces(Context context, DetectFacesRequest request, DetectFacesCompletion completion) Create request to detect faces and check face image quality- Parameters:
context- Application's contextrequest-DetectFacesRequestprocessing request configurationcompletion-DetectFacesCompletionthe block to call when request is finished processing.
-
isInitialized
public boolean isInitialized()Method returns state of FaceSDK core- Returns:
- true when FaceSDK core was initialized successfully
-
setOnClickListener
public void setOnClickListener(View.OnClickListener onClickListener) Set click listener for buttons from the UI customization layer- Parameters:
onClickListener- callback, see more View.OnClickListener }
-
setSaveLogs
public void setSaveLogs(boolean isSaveLog) Enable saving API logs to file- Parameters:
isSaveLog- pass true to enable logs.
-
setLogsFolder
Set path to log file- Parameters:
path- logs will be saved in this path.
-
setLogs
public void setLogs(boolean isEnable) Enable API logs- Parameters:
isEnable- pass true to enable logs.
-
getVersion
-
setLocale
-
getLocale
-
setTenant
-
getTenant
-
setEnv
-
getEnv
-
getInternalServiceUrl
-
closeLogHandler
protected void closeLogHandler() -
initApplicationPath
protected void initApplicationPath(Context context) -
startLogHandler
-
initSdk
protected void initSdk(Context context, LicenseConfig initConfig, FaceInitializationCompletion initCallback)
-