VerIDSessionActivity

Activity that runs a Ver-ID session

Package com.appliedrec.verid.ui2

public class VerIDSessionActivity

Implements

Methods

startSessionTask

Introduced in version 1.0.0

protected startSessionTask()

Start Ver-ID session

Begin executing Ver-ID session task. The task will report its progress by calling the onProgress method. When the session completes it will call the onComplete method.

finishWithResult

Introduced in version 1.0.0

protected finishWithResult(VerIDSessionResult)

Finish the session with a result

If the result is canceled this method will call com.appliedrec.verid.ui2.VerIDSessionActivity.html#finishCancel().

If the result contains an error this method will call com.appliedrec.verid.ui2.VerIDSessionActivity.html#finishWithError(Exception).

Otherwise this method sets the activity result and finishes the activity.

Override this method if wish to handle the result in this activity instead of passing it to the parent activity.

Parameters

sessionResult com.appliedrec.verid.core2.session.VerIDSessionResult
Session result

finishWithError

Introduced in version 1.0.0

protected finishWithError(Exception)

Finish the session with error

This method sets the activity result and finishes the activity.

Override this method if you wish to handle the error in this activity instead of passing it to the parent activity.

Parameters

error java.lang.Exception
Error

finishCancel

Introduced in version 1.0.0

protected finishCancel()

Cancel the session

This method sets the activity result to Activity.RESULT_CENCELED and finishes the activity.

Override this method if you wish to handle the session cancellation in this activity instead of finishing the activity.

getSessionSettings

Introduced in version 1.0.0

public getSessionSettings()

Returns

T
Session settings

getEnvironment

Introduced in version 1.0.0

protected getEnvironment()

Returns

com.appliedrec.verid.core2.VerID
Ver-ID environment used to run the Ver-ID session

onProgress

Introduced in version 1.0.0

public onProgress(SessionTask, VerIDSessionResult, FaceDetectionResult)

Called by com.appliedrec.verid.core2.SessionTask.html when the task generates a face detection result

Parameters

sessionTask com.appliedrec.verid.core2.SessionTask
The task that progressed
sessionResult com.appliedrec.verid.core2.session.VerIDSessionResult
The session result at the point of progress
faceDetectionResult com.appliedrec.verid.core2.session.FaceDetectionResult
Face detection result that was used to generate the session result

onComplete

Introduced in version 1.0.0

public onComplete(SessionTask, VerIDSessionResult)

Called by com.appliedrec.verid.core2.SessionTask.html when the session completes.

The default implementation shows the session result if the session settings requested it. Otherwise the method calls com.appliedrec.verid.ui2.VerIDSessionActivity.html#finishWithResult(VerIDSessionResult).

Parameters

sessionTask com.appliedrec.verid.core2.SessionTask
Task that completed
sessionResult com.appliedrec.verid.core2.session.VerIDSessionResult
Result of the task

makeSessionFailureDialogFactory

Introduced in version 1.0.0

In 1.12.0 See com.appliedrec.verid.ui2.VerIDSessionActivity.html#makeSessionFailureDialogFactory2()

protected makeSessionFailureDialogFactory()

Returns

com.appliedrec.verid.ui2.ISessionFailureDialogFactory
Instance of com.appliedrec.verid.ui2.ISessionFailureDialogFactory.html

makeSessionFailureDialogFactory2

Introduced in version 1.12.0

protected makeSessionFailureDialogFactory2()

Returns

com.appliedrec.verid.ui2.ISessionFailureDialogFactory2
Instance of com.appliedrec.verid.ui2.ISessionFailureDialogFactory2.html

showFailureDialog

Introduced in version 1.0.0

protected showFailureDialog(FaceDetectionResult, VerIDSessionResult)

Shows a dialog when the Ver-ID session fails due to the user not failing liveness detection and the user tried fewer than the maximum number of tries set in the session settings.

Parameters

faceDetectionResult com.appliedrec.verid.core2.session.FaceDetectionResult
Face detection result
sessionResult com.appliedrec.verid.core2.session.VerIDSessionResult
Session result

Returns

boolean
true if the dialog was shown

startTipsActivity

Introduced in version 1.11.0

protected startTipsActivity()

Start an activity showing face detection tips

makeResultEvaluationServiceFactory

Introduced in version 1.0.0

protected makeResultEvaluationServiceFactory()

Override this if you wish to supply your own instance of com.appliedrec.verid.core2.IResultEvaluationServiceFactory.html.

Returns

com.appliedrec.verid.core2.IResultEvaluationServiceFactory<T>
Result evaluation service factory

makeImageProviderServiceFactory

Introduced in version 1.0.0

protected makeImageProviderServiceFactory()

Override this if you want to supply your own instance of com.appliedrec.verid.core2.IImageProviderServiceFactory.html.

The default implementation uses this activity as the image provider service factory.

Returns

com.appliedrec.verid.core2.IImageProviderServiceFactory
Image provider service factory

makeImageProviderService

Introduced in version 1.0.0

public makeImageProviderService()

Override this if you want to supply your own com.appliedrec.verid.core2.IImageProviderService.html.

The default implementation uses this activity as the image provider service.

Returns

com.appliedrec.verid.core2.IImageProviderService
Image provider service

dequeueImage

Introduced in version 1.0.0

public dequeueImage()

Implementation of com.appliedrec.verid.core2.IImageProviderService.html.

Returns

com.appliedrec.verid.core2.VerIDImage
Image obtained from

Throws

java.lang.Exception
If the session fragment is {@literal null} or if the session expired

makeVerIDSessionFragment

Introduced in version 1.0.0

protected makeVerIDSessionFragment()

Create an instance of Fragment that implements the com.appliedrec.verid.ui2.IVerIDSessionFragment.html interface.

Returns

U
Fragment that implements com.appliedrec.verid.ui2.IVerIDSessionFragment.html

makeResultFragment

Introduced in version 1.0.0

protected makeResultFragment(VerIDSessionResult)

Create an instance of a Fragment that shows the result of the session.

This fragment will only be shown if com.appliedrec.verid.core2.session.VerIDSessionSettings.html#getShowResult() is set to true.

The fragment must call com.appliedrec.verid.ui2.ResultFragmentListener.html#onResultFragmentDismissed(IResultFragment) on the activity it's attached to when finished.

Parameters

sessionResult com.appliedrec.verid.core2.session.VerIDSessionResult
The result to display in the fragment

Returns

Fragment
Fragment

makeFaceDetectionServiceFactory

Introduced in version 1.0.0

protected makeFaceDetectionServiceFactory()

Override this if you wish to supply your own instance of com.appliedrec.verid.core2.IFaceDetectionServiceFactory.html.

The default implementation returns an instance of com.appliedrec.verid.core2.FaceDetectionServiceFactory.html.

Returns

com.appliedrec.verid.core2.IFaceDetectionServiceFactory
Instance of com.appliedrec.verid.core2.IFaceDetectionServiceFactory.html

makeImageWriterServiceFactory

Introduced in version 1.0.0

protected makeImageWriterServiceFactory()

Override this method if you wish to supply your own instance of com.appliedrec.verid.core2.IImageWriterServiceFactory.html.

The default implementation returns an instance of com.appliedrec.verid.core2.ImageWriterServiceFactory.html.

Returns

com.appliedrec.verid.core2.IImageWriterServiceFactory
Instance of com.appliedrec.verid.core2.IImageWriterServiceFactory.html

onResultFragmentDismissed

Introduced in version 1.0.0

public onResultFragmentDismissed(IResultFragment)

Called when the user dismisses the fragment showing the session result.

Parameters

resultFragment com.appliedrec.verid.ui2.IResultFragment
The fragment that was dismissed

Properties

EXTRA_SETTINGS

Introduced in version 1.0.0

public static final String EXTRA_SETTINGS

Intent extra name for settings

EXTRA_VERID_INSTANCE_ID

Introduced in version 1.0.0

public static final String EXTRA_VERID_INSTANCE_ID

Intent extra name for Ver-ID instance

EXTRA_RESULT

Introduced in version 1.0.0

public static final String EXTRA_RESULT

Intent extra name for session result

EXTRA_ERROR

Introduced in version 1.0.0

public static final String EXTRA_ERROR

Intent extra name for error