Data to be uploaded and analyzed is stored in object sdkMediaResult, obtained after capturing and recording video. Upload it to the server and initiate required analyses via Oz API.
A simple scenario of interaction with Oz API can be implemented with theuploadMediaAndAnalyze method as described below.
val statusListener = object: StatusListener<List<OzAnalysisResult>> {
override fun onStatusChanged(status: String?) { /*your code for showing status message*/ }
override fun onSuccess(result:List <OzAnalysisResult>) { /*your code to handle analysis result*/ }
override fun onError(error: OzException) { /*your code to handle analysis error*/ }
}
val analysisCancelable = OzLivenessSDK.uploadMediaAndAnalyze(
mediaList,
listOf(OzAnalysis.QUALITY, OzAnalysis.BIOMETRY),
statusListener
)
StatusListener<List<OzAnalysisResult>> statusListener = new StatusListener<List<OzAnalysisResult>>() {
@Override public void onStatusChanged(@Nullable String s) { /*your code for showing status message*/ }
@Override public void onSuccess(List<OzAnalysisResult> result) { /* your code to handle analysis result */ }
@Override public void onError(@NonNull OzException e) { /* your code to handle analysis error */ }
};
Cancelable analysisCancelable = OzLivenessSDK.INSTANCE.uploadMediaAndAnalyze(
mediaList,
Arrays.asList(OzAnalysis.QUALITY, OzAnalysis.BIOMETRY),
statusListener
);
On-Device Analyzes
To run the on-device analyses instead of server-based, use the following methods: