Class FaceSDK

java.lang.Object
com.regula.facesdk.FaceSDK

public final class FaceSDK extends Object
  • Field Details

    • defaultUrl

      protected final String defaultUrl
      See Also:
    • serviceUrl

      protected String serviceUrl
    • isFaceDetecting

      protected boolean isFaceDetecting
    • faceCaptureCallback

      protected FaceCaptureCallback faceCaptureCallback
    • mLivenessCallback

      protected LivenessCallback mLivenessCallback
    • isInitialized

      protected boolean isInitialized
    • videoEncoderCompletion

      protected WeakReference<IVideoEncoderCompletion> videoEncoderCompletion
  • Method Details

    • Instance

      public static FaceSDK Instance()
      A shared instance of the FaceSDK
      Returns:
      return instance of the FaceSDK class
    • init

      public void init(Context context, InitCallback initCallback)
      Prepares Face Recognition SDK to work
      Parameters:
      context - context
    • deinit

      public boolean deinit()
      Method to deinitialize FaceSDK core
      Returns:
      true when deinit was success
    • 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

      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

      public void matchFaces(MatchFacesRequest request, MatchFaceConfiguration 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
      invalid @linkplain
      face capture activity
      Parameters:
      context -
      invalid @link
      Context
      allows access to application-specific resources and classes
      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 - allows access to application-specific resources and classes
      configuration - provide configuration information (flags, cameraId and headers)
      completion - presentation of the FaceCaptureActivity callback
    • startLiveness

      public void startLiveness(Context context, LivenessCallback completion)
      Start liveness process
      Parameters:
      context -
      invalid @link
      Context
      allows access to application-specific resources and classes
      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 -
      invalid @link
      Context
      allows access to application-specific resources and classes
      configuration - LivenessConfiguration provide configuration information
      completion - LivenessCallback liveness ending callback
    • stopFaceCaptureActivity

      public void stopFaceCaptureActivity(Context context)
      Stop the face capturing and close finish FaceCaptureActivity by context
      Parameters:
      context -
      invalid @link
      Context
      allows access to application-specific resources and classes
    • stopLivenessProcessing

      public void stopLivenessProcessing(Context context)
      Stop the liveness processing and activity by context
      Parameters:
      context -
      invalid @link
      Context
      allows access to application-specific resources and classes
    • getFaceSdkVersion

      public String getFaceSdkVersion()
      Get the faceSdk version
      Returns:
      faceSdk module version in the String format
    • setNetworkInterceptorListener

      public void setNetworkInterceptorListener(NetworkInterceptorListener networkInterceptorListener)
      set listener to intercept any http request from FaceSDK
      Parameters:
      networkInterceptorListener -
      invalid @link
      NetworkInterceptorListener
      listener
    • setVideoEncoderCompletion

      public void setVideoEncoderCompletion(IVideoEncoderCompletion videoCompletedListener)
      set listener to finish uploading liveness video
      Parameters:
      videoCompletedListener -
      invalid @link
      IVideoEncoderCompletion
      listener
    • detectFaces

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

      protected String getInternalServiceUrl()