Package 

Interface PassioSDK

    • Method Detail

      • configure

         abstract Unit configure(PassioConfiguration passioConfiguration, Function1<PassioStatus, Unit> onComplete)

        Initializes the SDK with the given passioConfiguration. See PassioConfiguration for more information on the different types of SDK configuration. The initialization process includes downloading or reading a cached version of the license and loading the models into the TensorFlowLite runner. This process is being executed on a background thread, but the callback with the result of the configuration process will be called on the main thread. You may call startCamera or startFoodDetection before this method, there is no need to wait the onComplete callback.

        Parameters:
        passioConfiguration - the input configuration for the SDK.
        onComplete - the callback that will be called at the end of the configuration process with the result in the form of the {@link ai.passio.passiosdk.core.config.
      • startCamera

         abstract Unit startCamera(PassioCameraViewProvider passioCameraViewProvider, Integer displayRotation, PassioCameraViewProvider.CameraFacing cameraFacing, Boolean tapToFocus)

        Starts the camera preview with the given PassioCameraViewProvider. Using CameraX (https://developer.android.com/training/camerax), the camera system will start rendering the frames onto the PreviewView. Also this method binds the camera with the lifecycle provider of the CameraViewProvider. When that lifecycle provider calls onStart() the camera preview will start and when it calls onStop() the camera preview will stop and start the shutdown process. android.view.Surface.ROTATION_

        Parameters:
        passioCameraViewProvider - provides the PreviewView to render the camera frames, the lifecycle holder which will start and stop the camera, and also the context provider needed to open the camera.
        displayRotation - if the orientation changes are enabled, use this parameter to notify the camera of the display rotation.
        tapToFocus - set true to enable a tap listener on the passioCameraViewProvider's PreviewView that will start a manual focus operation.
      • enableFlashlight

         abstract Unit enableFlashlight(Boolean enabled)

        Turns the device's flashlight on or off.

        Parameters:
        enabled - if enabled is set to true, it will turn the flashlight on.
      • shutDownPassioSDK

         Unit shutDownPassioSDK()

        Finalizes the PassioSDK instance. Deallocates the memory reserved for TFLite models, transformation matrices and shuts down all the background queues that power the SDK. To run the SDK again, configure must be called.

      • getSDKVersion

         abstract String getSDKVersion()

        Current version of the Passio Platform SDK library.