Class FaceSDK


  • public final class FaceSDK
    extends BaseRegulaSDK
    • Field Detail

      • serviceUrl

        protected java.lang.String serviceUrl
      • isFaceDetecting

        protected boolean isFaceDetecting
      • isInitialized

        protected boolean isInitialized
      • onClickListener

        protected View.OnClickListener onClickListener
      • sessionPath

        protected java.lang.String sessionPath
    • 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
      • deinit

        @Deprecated
        public boolean deinit()
        Deprecated.
        Method to deinitialize FaceSDK core, use deinitialize() 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
      • setServiceUrl

        public void setServiceUrl​(java.lang.String url)
        Set the URL of your service.
        Parameters:
        url - An Url in the String format FaceSDK face = FaceSDK().Instance(); face.setServiceUrl("https://api.example.com");
      • 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 request
        configuration - 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 context
        completion - 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 context
        configuration - 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 context
        configuration - provide configuration information (flags, cameraId and headers)
        completion - presentation of the FaceCaptureActivity callback
        callback - 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 context
        completion - LivenessCallback the block to execute after the onLivenessCompete finishes.
      • 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 use getVersion()
      • 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
      • 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.
      • getInternalServiceUrl

        protected java.lang.String getInternalServiceUrl()
      • closeLogHandler

        protected void closeLogHandler()
      • initApplicationPath

        protected void initApplicationPath​(Context context)
      • startLogHandler

        protected void startLogHandler​(java.lang.String transactionId)