Android SDK Methods and Properties
OzLivenessSDK
A singleton for Oz SDK.
clearActionVideos
Deletes all action videos from file system.
Parameters
-
Returns
-
createStartIntent
Creates an intent to start the Liveness activity.
Returns
-
getErrorFromIntent
Utility function to get the SDK error from OnActivityResult's intent.
data
Intent
The object to test
Returns
The error text – String.
getLicensePayload
Retrieves the SDK license payload.
Parameters
-
Returns
The license payload (LicensePayload) – the object that contains the extended info about licensing conditions.
getResultFromIntent
Utility function to get SDK results from OnActivityResult's intent.
data
Intent
The object to test
Returns
A list of OzAbstractMedia objects.
init
Initializes SDK with license sources.
context
Context
The Context class
statusListener
StatusListener
Optional listener to check the license load result
Returns
-
log
Enables logging using the Oz Liveness SDK logging mechanism.
tag
String
Message tag
log
String
Message log
Returns
-
setApiConnection
Sets connection to Oz API.
statusListener
StatusListener<String?>
Listener
setEventsConnection
Sets connection to the telemetry server.
statusListener
StatusListener<String?>
Listener
logout
Deletes the saved token.
Parameters
-
Returns
-
getEventSessionId
Retrieves the telemetry session ID.
Parameters
-
Returns
The telemetry session ID (String).
version
Retrieves the SDK version.
Parameters
-
Returns
The SDK version (String).
generateSignedPayload
Generates the payload with media signatures.
folderMeta (optional)
[string:any]
Additional folder metadata
Returns
Payload to be sent along with media files that were used for generation.
setEnvironment
Sets the SDK environment for debugging or production.
AnalysisRequest
A class for performing checks.
run
The analysis launching method.
onStatusChange
A callback function as follows:
onStatusChange(status: AnalysisRequest.AnalysisStatus) { handleStatus() }
The function is executed when the status of the AnalysisRequest changes
onError
A callback function as follows:
onError(error: OzException) { handleError() }
The function is executed in case of errors
onSuccess
The function is executed when all the analyses are completed
class Builder
A builder class for AnalysisRequest.
build
Creates the AnalysisRequest instance.
Parameters
-
Returns
The AnalysisRequest class instance.
addAnalysis
Adds an analysis to your request.
Returns
Error if any.
addAnalyses
Adds a list of analyses to your request. Allows executing several analyses for the same folder on the server side.
Returns
Error if any.
addFolderMeta
Adds metadata to a folder you create (for the server-based analyses only). You can add a pair key-value as additional information to the folder with the analysis result on the server side.
key
String
Key for metadata
value
String
Value for metadata
Returns
Error if any.
uploadMedia
Uploads one or more media to a folder.
Returns
Error if any.
setFolderId
For the previously created folder, sets a folderId. The folder should exist on the server side. Otherwise, a new folder will be created.
folderID
String
A folder identifier
Returns
Error if any.
useInstantMode
Manages interaction with Instant API. Set to true to enable the non-persistent API mode (useInstantMode(true)).
OzConfig
Configuration for OzLivenessSDK (use OzLivenessSDK.config).
setSelfieLength
Sets the length of the Selfie gesture (in milliseconds).
selfieLength
Int
The length of the Selfie gesture (in milliseconds). Should be within 500-5000 ms, the default length is 700
Returns
Error if any.
allowDebugVisualization
The possibility to enable additional debug info by clicking on version text.
allowDebugVisualization
Boolean
Enables or disables the debug info
attemptSettings
The number of attempts before SDK returns error.
uploadMediaSettings
Settings for repeated media upload.
faceAlignmentTimeout
Timeout for face alignment (measured in milliseconds).
faceAlignmentTimeout
Long
A timeout value
livenessErrorCallback
Interface implementation to retrieve error by Liveness detection.
livenessErrorCallback
ErrorHandler
A callback value
localizationCode
Locale to display string resources.
logging
Logging settings.
useMainCamera
Uses the main (rear) camera instead of the front camera for liveness detection.
useMainCamera
Boolean
True – rear camera,
False – front camera
disableFramesCountValidation
Disables the option that prevents videos to be too short (3 frames or less).
disableFramesCountValidation
Boolean
True – validation is off,
False – validation is on
UICustomization
Customization for OzLivenessSDK (use OzLivenessSDK.config.customization).
hideStatusBar
Hides the status bar and the three buttons at the bottom. The default value is True.
toolbarCustomization
A set of customization parameters for the toolbar.
closeIconRes
Int (@DrawableRes)
An image for the close button
titleTextFont
Int (@FontRes)
Toolbar title text font
titleTextFontStyle
Int (values from android.graphics.Typeface properties, e.g., Typeface.BOLD)
Toolbar title text font style
titleTextSize
Int
Toolbar title text size (in sp, 12-18)
titleTextAlpha
Int
Toolbar title text opacity (in %, 0-100)
backgroundAlpha
Int
Toolbar background opacity (in %, 0-100)
isTitleCentered
Boolean
Defines whether the text on the toolbar is centered or not
title
String
Text on the toolbar
centerHintCustomization
A set of customization parameters for the center hint that guides a user through the process of taking an image of themselves.
textFont
String
Center hint text font
textStyle
Int (values from android.graphics.Typeface properties, e.g.,Typeface.BOLD)
Center hint text style
textSize
Int
Center hint text size (in sp, 12-34)
textAlpha
Int
Center hint text opacity (in %, 0-100)
verticalPosition
Int
Center hint vertical position from the screen bottom (in %, 0-100)
backgroundOpacity
Int
Center hint background opacity
backgroundCornerRadius
Int
Center hint background frame corner radius (in dp, 0-20)
hintAnimation
A set of customization parameters for the hint animation.
hintGradientOpacity
Int
Gradient opacity
animationIconSize
Int
A side size of the animation icon square
hideAnimation
Boolean
A switcher for hint animation, if True, the animation is hidden
faceFrameCustomization
A set of customization parameters for the frame around the user face.
cornerRadius
Int
Rectangle corner radius (in dp, 0-20)
strokeAlpha
Int
Frame opacity (in %, 0-100)
strokeWidth
Int
Frame stroke width (in dp, 0-20)
strokePadding
Int
A padding from the stroke to the face alignment area (in dp, 0-10)
backgroundCustomization
A set of customization parameters for the background outside the frame.
backgroundAlpha
Int
Background opacity (in %, 0-100)
versionTextCustomization
A set of customization parameters for the SDK version text.
textFont
Int (@FontRes)
SDK version text font
textSize
Int
SDK version text size (in sp, 12-16)
textAlpha
Int
SDK version text opacity (in %, 20-100)
antiscamCustomization
A set of customization parameters for the alert message that warns user about their actions being recorded. This message is placed above the oval.
textMessage
String
Antiscam message text
textFont
String
Antiscam message text font
textSize
Int
Antiscam message text size (in px, 12-18)
textAlpha
Int
Antiscam message text opacity (in %, 0-100)
backgroundOpacity
Int
Antiscam message background opacity
cornerRadius
Int
Background frame corner radius (in px, 0-20)
logoCustomization
Logo customization parameters. Custom logo should be allowed by license. By default, logo is placed on the bottom left.
image
Bitmap (@DrawableRes)
Logo image
size
Size
Logo size (in dp)
verticalPosition
Int (0-100), default: 100
Vertical offset
horizontalPosition
Int (0-100), default: 0
Horizontal offset
Variables and objects
enum OzAction
Contains the action from the captured video.
On January 1, 2027, the One Shot gesture will become unavailable. Please plan your migration.
OneShot
The best shot from the video taken
Blank
A selfie with face alignment check
Scan
Scan
HeadRight
Head turned right
HeadLeft
Head turned left
HeadDown
Head tilted downwards
HeadUp
Head lifted up
EyeBlink
Blink
Smile
Smile
class LicensePayload
Contains the extended info about licensing conditions.
expires
Float
The expiration interval
features
Features
License features
appIDS
List<String>
An array of bundle IDs
sealed class OzAbstractMedia
A class for the captured media that can be:
OzDocumentPhoto
A document photo.
photoPath
String
An absolute path to a photo
additionalTags (optional)
String
Additional tags if needed (including those not from the OzMediaTag enum)
metaData
Map<String, String>
Media metadata
OzShotSet
A set of shots in an archive.
archivePath
String
A path to an archive
additionalTags (optional)
String
Additional tags if needed (including those not from the OzMediaTag enum)
metaData
Map<String, String>
Media metadata
OzVideo
A Liveness video.
videoPath
String
A path to a video
bestShotPath (optional)
String
URL of the best shot in PNG
preferredMediaPath (optional)
String
URL of the API media container
additionalTags (optional)
String
Additional tags if needed (including those not from the OzMediaTag enum)
metaData
Map<String, String>
Media metadata
enum OzMediaTag
Contains an action from the captured video.
On January 1, 2027, the One Shot gesture will become unavailable. Please plan your migration.
Blank
A video with no gesture
PhotoSelfie
A selfie photo
VideoSelfieOneShot
A video with the best shot taken
VideoSelfieScan
A video with the scanning gesture
VideoSelfieEyes
A video with the blink gesture
VideoSelfieSmile
A video with the smile gesture
VideoSelfieHigh
A video with the lifting head up gesture
VideoSelfieDown
A video with the tilting head downwards gesture
VideoSelfieRight
A video with the turning head right gesture
VideoSelfieLeft
A video with the turning head left gesture
PhotoIdPortrait
A photo from a document
PhotoIdBack
A photo of the back side of the document
PhotoIdFront
A photo of the front side of the document
sealed class LicenseSource
A class for license that can be:
LicenseAssetId
Contains the license ID.
id
Int
License ID
LicenseFilePath
Contains the path to a license.
path
String
An absolute path to a license
class AnalysisStatus
A class for analysis status that can be:
RunningAnalysis
This status means the analysis is launched.
UploadingMedia
This status means the media is being uploaded.
index
Int
Number of this object in a list
from
Int
Objects quantity
percentage
Int
Completion percentage
enum Type
The type of the analysis.
BIOMETRY
The algorithm that allows comparing several media and check if the people on them are the same person or not
QUALITY
The algorithm that aims to check whether a person in a video is a real human acting in good faith, not a fake of any kind.
DOCUMENTS (deprecated)
The analysis that aims to recognize the document and check if its fields are correct according to its type.
enum Mode
The mode of the analysis.
ON_DEVICE
The on-device analysis with no server needed
SERVER_BASED
The server-based analysis
HYBRID
The hybrid analysis for Liveness: if the score received from an on-device analysis is too high, the system initiates a server-based analysis as an additional check.
class Analysis
Contains information on what media to analyze and what analyses to apply.
type
Type
The type of the analysis
mode
Mode
The mode of the analysis
params (optional)
Map<String, Any>
Additional parameters
sizeReductionStrategy
Defines what type of media is being sent to the server in case of the hybrid analysis once the on-device analysis is finished successfully
enum Resolution
The general status for all analyses applied to the folder created.
FAILED
One or more analyses failed due to some error and couldn't get finished
DECLINED
The check failed (e.g., faces don't match or some spoofing attack detected)
SUCCESS
Everything went fine, the check succeeded (e.g., faces match or liveness confirmed)
OPERATOR_REQUIRED
The result should be additionally checked by a human operator
class OzAttemptsSettings
Holder for attempts counts before SDK returns error.
singleCount
Int
Attempts on a single action/gesture
commonCount
Int
Total number of attempts on all actions/gestures if you use a sequence of them
enum OzLocalizationCode
Contains the locale code according to ISO 639-1.
EN
English
HY
Armenian
KK
Kazakh
KY
Kyrgyz
TR
Turkish
ES
Spanish
PT-BR
Portuguese (Brazilian)
class OzLogging
Contains logging settings.
allowDefaultLogging
Boolean
Allows logging to LogCat
allowFileLogging
Boolean
Allows logging to an internal file
journalObserver
StatusListener
An event listener to receive journal events on the application side
sealed class Color
A class for color that can be (depending on the value received):
ColorRes
resId
Int
Link to the color in the Android resource system
ColorHex
hex
String
Color hex (e.g., #FFFFFF)
ColorInt
color
Int
The Int value of a color in Android
enum GeometryType
Frame shape settings.
Oval
Oval frame
Rectangle
Rectangular frame
Circle
Circular frame
Square
Square frame
class AnalysisError
Exception class for AnalysisRequest.
apiErrorCode
Int
Error code
message
String
Error message
class SourceMedia
Structure that describes media used in AnalysisRequest.
mediaId
String
Media identifier
mediaType
String
Type of the media
originalName
String
Original media name
tags
List<String>
Tags for media
class ResultMedia
Structure that describes the analysis result for the single media.
confidenceScore
Float
Resulting score
isOnDevice
Boolean
Mode of the analysis
class RequestResult
Consolidated result for all analyses performed.
folderId
String
Folder identifier
class AnalysisResult
Result of the analysis for all media it was applied to.
confidenceScore
Float
Resulting score
analysisId
String
Analysis identifier
params
@RawValue Map<String, Any>
Additional folder parameters
serverRawResponse
String
Response from backend
class OzConnection
Defines the authentication method.
OzConnection.fromServiceToken
Authentication via token.
OzConnection.fromCredentials
Authentication via credentials.
host
String
API address
username
String
User name
password
String
Password
class OzUploadMediaSettings
Defines the settings for the repeated media upload.
attemptsCount
Int
Number of attempts for media upload
attemptsTimeout
Int
Timeout between attempts
enum SizeReductionStrategy
Defines what type of media is being sent to the server in case of the hybrid analysis once the on-device analysis is finished successfully. By default, the system uploads the compressed video.
UPLOAD_ORIGINAL
The original video
UPLOAD_COMPRESSED
The compressed video
UPLOAD_BEST_SHOT
The best shot taken from the video
UPLOAD_NOTHING
Nothing is sent (note that no folder will be created)
sslPin
Contains information about the whitelisted certificates.
hash
String
SHA256 key hash in base64
expiredAt
UNIX timestamp, UTC time
The date of certificate expiration
enum Environment
Defines what environment to use.
The DEBUG mode should only be used during active development and testing. All builds intended for end users must be configured to use the PRODUCTION mode to maintain the security posture and compliance requirements expected of production deployments.
DEBUG
Strictness of the SDK security checks is lowered so that the application can run with a debugger attached. Intended for development and debugging
PRODUCTION (default)
All security checks are enabled. Intended for release builds
The method affects security checks only; the SDK functionality does not change.
OzCapsula data container
The methods below apply to the new feature – OzCapsula data container that has been implemented in 8.22.
addContainer
This method replaces addAnalysis in the AnalysisRequest structure when you use the data container flow.
Input
DataContainer
bytearray[]
An encrypted file containing media and collateral info, the output of the createMediaCaptureScreen method
createMediaCaptureScreen
Captures media file with all information you need and packages it into a data container.
Input
session_token
String
Token required for OzCapsula flow
Output
DataContainer
bytearray[]
An encrypted file containing media and collateral info
public data class CaptureRequest
Detects a request for video capture.
analysisProfileList
List<AnalysisProfile>
A list of objects that contain information on media and analyses that should be applied to them
folderMeta (optional)
Map<String, Any>
Additional folder metadata
additionalMediaList (optional)
List<MediaRequest>
Media files that you need to upload to server, but it’s not necessary for analyses
cameraPosition (optional)
String
front (default) – front camera
back – rear camera
public data class AnalysisProfile
Contains information on media files and analyses that should be applied to them.
params (optional)
Map<String, Any>
Additional analysis parameters
public sealed class MediaRequest
Stores information about a media file.
Please note: you should add actionMedia OR userMedia, these parameters are mutually exclusive.
id
String (UUID v4)
Media ID
Error description
ERROR = 3
Error.
An unknown error has happened
ATTEMPTS_EXHAUSTED_ERROR = 4
Error. Attempts exhausted for liveness action.
The number of action attempts is exceeded
VIDEO_RECORD_ERROR = 5
Error by video record.
An error happened during video recording
FORCE_CLOSED = 7
Error. Liveness activity is force closed from client application.
A user closed the Liveness screen during video recording
DEVICE_HAS_NO_FRONT_CAMERA = 8
Error. Device has not front camera.
No front camera found
DEVICE_HAS_NO_MAIN_CAMERA = 9
Error. Device has not main camera.
No rear camera found
DEVICE_CAMERA_CONFIGURATION_NOT_SUPPORTED = 10
Error. Device camera configuration is not supported.
Oz Liveness doesn't support the camera configuration of the device
FACE_ALIGNMENT_TIMEOUT = 12
Error. Face alignment timeout in OzLivenessSDK.config.faceAlignmentTimeout milliseconds
Time limit for the face alignment is exceeded
ERROR = 13
The check was interrupted by user
User has closed the screen during the Liveness check.
Data container errors
session_token_is_empty
Session token must not be empty
Missing session token which is a mandatory parameter
data_container_internal_failure_1
Internal failure occurred while processing the data container
Not enough memory
data_container_internal_failure_2
data_container_internal_failure_3
data_container_internal_failure_4
Internal failure occurred while processing the data container
Couldn't generate a container
data_container_internal_failure_1000
Internal failure occurred while processing the data container
Any other error not mentioned above
If during the capture process an error prevents a user from completing the workflow, the data container is deleted.
Last updated
Was this helpful?
