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>> {overridefunonStatusChanged(status: String?) { /*your code for showing status message*/ }overridefunonSuccess(result:List <OzAnalysisResult>) { /*your code to handle analysis result*/ }overridefunonError(error: OzException) { /*your code to handle analysis error*/ } }val analysisCancelable = OzLivenessSDK.uploadMediaAndAnalyze( mediaList,listOf(OzAnalysis.QUALITY, OzAnalysis.BIOMETRY), statusListener )
StatusListener<List<OzAnalysisResult>> statusListener =newStatusListener<List<OzAnalysisResult>>() { @OverridepublicvoidonStatusChanged(@NullableString s) { /*your code for showing status message*/ } @Override public void onSuccess(List<OzAnalysisResult> result) { /* your code to handle analysis result */ }
@OverridepublicvoidonError(@NonNullOzException 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: