Package com.regula.facesdk
Class FaceSDK
com.regula.facesdk.FaceSDK
public final class FaceSDK
-
Field Summary
Modifier and TypeFieldDescriptionprotected Customization
protected final String
protected FaceCaptureCallback
protected boolean
protected boolean
protected FaceCaptureNotificationCallback
protected LivenessCallback
protected LivenessNotificationCallback
protected View.OnClickListener
protected String
protected String
protected FaceSDKVersion
protected WeakReference<IVideoEncoderCompletion>
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
boolean
deinit()
Deprecated.boolean
Method to deinitialize FaceSDK corevoid
detectFaces
(DetectFacesRequest request, DetectFacesCompletion completion) Create request to detect faces and check face image qualityseeCustomization
descriptionDeprecated.protected String
Getting url of the servicevoid
init
(Context context, FaceInitializationCompletion initCallback) Deprecated.protected void
initApplicationPath
(Context context) void
initialize
(Context context, FaceInitializationCompletion initCallback) Prepares Face Recognition SDK to work, usevoid
initialize
(Context context, InitializationConfiguration initConfig, FaceInitializationCompletion initCallback) Prepares Face Recognition SDK to work with licenseprotected void
initSdk
(Context context, InitializationConfiguration initConfig, FaceInitializationCompletion initCallback) static FaceSDK
Instance()
A shared instance of the FaceSDKboolean
Method returns state of FaceSDK corevoid
matchFaces
(MatchFacesRequest request, MatchFaceCallback completion) Deprecated.void
matchFaces
(MatchFacesRequest request, MatchFacesConfiguration configuration, MatchFaceCallback completion) Deprecated.void
matchFaces
(Context context, MatchFacesRequest request, MatchFaceCallback completion) Create match faces request for matching input on the similarity.void
matchFaces
(Context context, MatchFacesRequest request, MatchFacesConfiguration configuration, MatchFaceCallback completion) Creates match faces request to match input on the similarityvoid
presentFaceCaptureActivity
(Context context, FaceCaptureCallback completion) Start the face capture activityvoid
presentFaceCaptureActivity
(Context context, FaceCaptureCallback completion, FaceCaptureNotificationCallback callback) Start the face capture activityvoid
presentFaceCaptureActivity
(Context context, FaceCaptureConfiguration configuration, FaceCaptureCallback completion) Start the FaceCaptureActivityvoid
presentFaceCaptureActivity
(Context context, FaceCaptureConfiguration configuration, FaceCaptureCallback completion, FaceCaptureNotificationCallback callback) Start the FaceCaptureActivityvoid
setLogs
(boolean isEnable) Enable API logsvoid
setLogsFolder
(String path) Set path to log filevoid
setNetworkInterceptorListener
(NetworkInterceptorListener networkInterceptorListener) set listener to intercept any http request from FaceSDKvoid
setOnClickListener
(View.OnClickListener onClickListener) Set click listener for buttons from the UI customization layervoid
setSaveLogs
(boolean isSaveLog) Enable saving API logs to filevoid
setServiceUrl
(String url) Set the URL of your service.void
setVideoEncoderCompletion
(IVideoEncoderCompletion videoCompletedListener) set listener to finish uploading liveness videovoid
startLiveness
(Context context, LivenessCallback completion) Start liveness processvoid
startLiveness
(Context context, LivenessCallback completion, LivenessNotificationCallback callback) Start liveness processvoid
startLiveness
(Context context, LivenessConfiguration configuration, LivenessCallback completion) Start liveness activityvoid
startLiveness
(Context context, LivenessConfiguration configuration, LivenessCallback completion, LivenessNotificationCallback notification) Start liveness activityprotected void
startLogHandler
(String transactionId) void
stopFaceCaptureActivity
(Context context) Stop the face capturing and close finish FaceCaptureActivity by contextvoid
stopLivenessProcessing
(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
-
-
Method Details
-
Instance
A shared instance of the FaceSDK- Returns:
- return instance of the
FaceSDK
class
-
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
-
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
String
format.
-
matchFaces
Deprecated.As of 6.3, usematchFaces(Context, MatchFacesRequest, MatchFaceCallback)
Create match faces request for matching input on the similarity.- Parameters:
request
-MatchFacesRequest
Match faces request.completion
-MatchFaceCallback
the block to execute after the presentation finishes.
-
matchFaces
@Deprecated public void matchFaces(MatchFacesRequest request, MatchFacesConfiguration configuration, MatchFaceCallback completion) Deprecated.Creates match faces request to match input on the similarity- Parameters:
request
- Match faces requestconfiguration
- FaceCaptureConfiguration the configuration information.completion
- MatchFaceCallback The block to execute after the presentation finishes.
-
matchFaces
Create match faces request for matching input on the similarity.- Parameters:
request
-MatchFacesRequest
Match faces request.completion
-MatchFaceCallback
the 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:
request
- 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
-FaceCaptureCallback
callback 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
-FaceCaptureCallback
callback 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
-ICameraSwitchCallback
callback that receiving event of switch camera by an user
-
startLiveness
Start liveness process- Parameters:
context
- Application's contextcompletion
-LivenessCallback
the 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
-LivenessConfiguration
provide configuration informationcompletion
-LivenessCallback
liveness ending callback
-
startLiveness
public void startLiveness(Context context, LivenessCallback completion, LivenessNotificationCallback callback) Start liveness process- Parameters:
context
- Application's contextcompletion
-LivenessCallback
the block to execute after the onLivenessCompete finishes.callback
-ICameraSwitchCallback
callback 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
-LivenessConfiguration
provide configuration informationcompletion
-LivenessCallback
liveness ending callbacknotification
-NotificationCallback
liveness 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
String
format usegetVersion()
-
setNetworkInterceptorListener
set listener to intercept any http request from FaceSDK- Parameters:
networkInterceptorListener
-NetworkInterceptorListener
listener
-
setVideoEncoderCompletion
set listener to finish uploading liveness video- Parameters:
videoCompletedListener
-IVideoEncoderCompletion
listener
-
getCustomization
seeCustomization
description -
detectFaces
Create request to detect faces and check face image quality- Parameters:
request
-DetectFacesRequest
processing request configurationcompletion
-DetectFacesCompletion
the 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
-
getInternalServiceUrl
-
closeLogHandler
protected void closeLogHandler() -
initApplicationPath
protected void initApplicationPath(Context context) -
startLogHandler
-
initSdk
protected void initSdk(Context context, InitializationConfiguration initConfig, FaceInitializationCompletion initCallback)
-
matchFaces(Context, MatchFacesRequest, MatchFaceCallback)