Package com.regula.facesdk
Class FaceSDK
- java.lang.Object
-
- BaseRegulaSDK
-
- com.regula.facesdk.FaceSDK
-
public final class FaceSDK extends BaseRegulaSDK
-
-
Field Summary
Fields Modifier and Type Field Description protected Customization
customization
protected java.lang.String
defaultUrl
protected FaceCaptureCallback
faceCaptureCallback
protected boolean
isFaceDetecting
protected boolean
isInitialized
protected FaceCaptureNotificationCallback
mFaceCaptureNotificationCallback
protected LivenessCallback
mLivenessCallback
protected LivenessNotificationCallback
mNotificationCallback
protected View.OnClickListener
onClickListener
protected java.lang.String
serviceUrl
protected java.lang.String
sessionPath
protected FaceSDKVersion
version
protected java.lang.ref.WeakReference<IVideoEncoderCompletion>
videoEncoderCompletion
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected void
closeLogHandler()
boolean
deinit()
Deprecated.boolean
deinitialize()
Method to deinitialize FaceSDK corevoid
detectFaces(DetectFacesRequest request, DetectFacesCompletion completion)
Create request to detect faces and check face image qualityCustomization
getCustomization()
seeCustomization
descriptionjava.lang.String
getFaceSdkVersion()
Deprecated.protected java.lang.String
getInternalServiceUrl()
java.lang.String
getServiceUrl()
Getting url of the serviceFaceSDKVersion
getVersion()
void
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
isInitialized()
Method returns state of FaceSDK corevoid
matchFaces(MatchFacesRequest request, MatchFaceCallback completion)
Deprecated.As of 6.3, use#matchFaces(Context, MatchFacesRequest, MatchFaceCallback)
void
matchFaces(MatchFacesRequest request, MatchFacesConfiguration configuration, MatchFaceCallback completion)
Deprecated.As of 6.3, use#matchFaces(Context, MatchFacesRequest, MatchFacesConfiguration, MatchFaceCallback)
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 similarityIPersonDatabase
personDatabase()
void
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(java.lang.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(java.lang.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(java.lang.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 Detail
-
defaultUrl
protected final java.lang.String defaultUrl
- See Also:
- Constant Field Values
-
serviceUrl
protected java.lang.String serviceUrl
-
isFaceDetecting
protected boolean isFaceDetecting
-
faceCaptureCallback
protected FaceCaptureCallback faceCaptureCallback
-
mLivenessCallback
protected LivenessCallback mLivenessCallback
-
mNotificationCallback
protected LivenessNotificationCallback mNotificationCallback
-
mFaceCaptureNotificationCallback
protected FaceCaptureNotificationCallback mFaceCaptureNotificationCallback
-
isInitialized
protected boolean isInitialized
-
videoEncoderCompletion
protected java.lang.ref.WeakReference<IVideoEncoderCompletion> videoEncoderCompletion
-
customization
protected Customization customization
-
onClickListener
protected View.OnClickListener onClickListener
-
sessionPath
protected java.lang.String sessionPath
-
version
protected FaceSDKVersion version
-
-
Method Detail
-
Instance
public static FaceSDK Instance()
A shared instance of the FaceSDK- Returns:
- return instance of the
FaceSDK
class
-
init
@Deprecated public void init(Context context, FaceInitializationCompletion initCallback)
Deprecated.Prepares Face Recognition SDK to work, use#initialize(Context, FaceInitializationCompletion)
instead- Parameters:
context
- Application's context- Since:
- 6.1
-
initialize
public void initialize(Context context, FaceInitializationCompletion initCallback)
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 public boolean 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
public IPersonDatabase personDatabase()
-
setServiceUrl
public void setServiceUrl(java.lang.String url)
Set the URL of your service.
-
getServiceUrl
public java.lang.String getServiceUrl()
Getting url of the service- Returns:
- An URL of your service in the
String
format.
-
matchFaces
@Deprecated public void matchFaces(MatchFacesRequest request, MatchFaceCallback completion)
Deprecated.As of 6.3, use#matchFaces(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.As of 6.3, use#matchFaces(Context, MatchFacesRequest, MatchFacesConfiguration, MatchFaceCallback)
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
public void matchFaces(Context context, MatchFacesRequest request, MatchFaceCallback completion)
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
public void presentFaceCaptureActivity(Context context, FaceCaptureCallback completion)
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
public void startLiveness(Context context, LivenessCallback completion)
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 public java.lang.String getFaceSdkVersion()
Deprecated.Get the faceSdk version- Returns:
- faceSdk module version in the
String
format usegetVersion()
-
setNetworkInterceptorListener
public void setNetworkInterceptorListener(NetworkInterceptorListener networkInterceptorListener)
set listener to intercept any http request from FaceSDK- Parameters:
networkInterceptorListener
-NetworkInterceptorListener
listener
-
setVideoEncoderCompletion
public void setVideoEncoderCompletion(IVideoEncoderCompletion videoCompletedListener)
set listener to finish uploading liveness video- Parameters:
videoCompletedListener
-IVideoEncoderCompletion
listener
-
getCustomization
public Customization getCustomization()
seeCustomization
description
-
detectFaces
public void detectFaces(DetectFacesRequest request, DetectFacesCompletion completion)
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
public void setLogsFolder(java.lang.String path)
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
public FaceSDKVersion getVersion()
-
getInternalServiceUrl
protected java.lang.String getInternalServiceUrl()
-
closeLogHandler
protected void closeLogHandler()
-
initApplicationPath
protected void initApplicationPath(Context context)
-
startLogHandler
protected void startLogHandler(java.lang.String transactionId)
-
initSdk
protected void initSdk(Context context, InitializationConfiguration initConfig, FaceInitializationCompletion initCallback)
-
-