Class FaceSDK

com.regula.facesdk.FaceSDK

public final class FaceSDK
  • Field Details

  • Method Details

    • 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, 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
    • personDatabase

      public IPersonDatabase personDatabase()
    • setServiceUrl

      public void setServiceUrl(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 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)
      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)
      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.
    • 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 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, FaceCaptureCallback completion, FaceCaptureNotificationCallback callback)
      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.
    • startLiveness

      public void startLiveness(Context context, LivenessConfiguration configuration, LivenessCallback completion)
      Start liveness activity
      Parameters:
      context - Application's context
      configuration - LivenessConfiguration provide configuration information
      completion - LivenessCallback liveness ending callback
    • startLiveness

      public void startLiveness(Context context, LivenessCallback completion, LivenessNotificationCallback callback)
      Start liveness process
      Parameters:
      context - Application's context
      completion - 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 context
      configuration - LivenessConfiguration provide configuration information
      completion - LivenessCallback liveness ending callback
      notification - 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 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
    • getCustomization

      public Customization getCustomization()
      see Customization description
    • detectFaces

      public void detectFaces(DetectFacesRequest request, DetectFacesCompletion completion)
      Create request to detect faces and check face image quality
      Parameters:
      request - DetectFacesRequest processing request configuration
      completion - 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(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 String getInternalServiceUrl()
    • closeLogHandler

      protected void closeLogHandler()
    • initApplicationPath

      protected void initApplicationPath(Context context)
    • startLogHandler

      protected void startLogHandler(String transactionId)
    • initSdk

      protected void initSdk(Context context, InitializationConfiguration initConfig, FaceInitializationCompletion initCallback)