Package com.regula.documentreader.api
Class DocumentReader
java.lang.Object
BaseDocumentReader
com.regula.documentreader.api.DocumentReader
public final class DocumentReader
extends BaseDocumentReader
Class, which provides API for easy MRZ recognizing and results receiving.
Takes care of initializing and configuring all necessary resources.
-
Field Summary
FieldsModifier and TypeFieldDescriptionList of supported processing scenariosEnvironment typesession idCustomer nameDetailed information about initialized DocumentReader instance, seeDocReaderVersionfor more details -
Method Summary
Modifier and TypeMethodDescriptionvoidaddPKDCertificates(List<PKDCertificate> certificates) function which pass Rfid certificates to CorebooleancancelDBUpdate(Context context) Use this method to cancel downloading the document description databasevoidcheckDatabaseUpdate(Context context, String databaseId, ICheckDatabaseUpdate completion) Use this method to check database update internet permission requiredvoidfunction which clear all certificates in CorevoidcreatePerson(List<FaceImage> faceImages, ICreatePersonCompletion completion) Use this method to create a persona on the backendseeParamsCustomizationdescriptionvoidUse this method to unload the Document Reader and free used resourcesvoidvoidseeFunctionalitydescriptionUse this method to receive document reader statusMethod to get current video capture session idvoidinitializeReader(Context context, BleDeviceConfig config, IDocumentReaderInitCompletion completion) Performs the resource loading and overall initialization of Document Reader instance asynchronouslyvoidinitializeReader(Context context, DocReaderConfig config, IDocumentReaderInitCompletion completion) Performs the resource loading and overall initialization of Document Reader instance asynchronously The initialization is performed fully offline, although by default the SDK attempts to access the licensing server to keep your license updated.static DocumentReaderInstance()This method returns a single instance of DocumentReader classbooleanUse this to check if Mobile authenticator available for usebooleanAllows you to check if you can use external Regula Bluetooth devices based on your license, available scenarios and Core framework capabilitiesbooleanisReady()Use this method, to check if document reader is ready to workbooleanAllows you to check if native RFID chip reading can be performed based on your license and Core framework capabilitieslicense()seeLicensedescriptionvoidprepareDatabase(Context context, String databaseID, IDocumentReaderPrepareCompletion completion) Deprecated.voidprepareDatabase(Context context, String databaseID, IDocumentReaderPrepareDbCompletion completion) Use this method to check if document description database is present and download it, if notseeProcessParamdescriptionvoidreadRFID(IsoDep tag, IRfidCompletion completion) Use this method, to read data from detected chip using NFCvoidreadRFID(IsoDep tag, IRfidCompletion completion, IRfidReaderRequest request) Use this method, to read data from detected chip using NFCvoidrecognize(RecognizeConfig config, IDocumentReaderCompletion completion) Use this method to process single or multiple images (e.g.voidrecognize(Context context, RecognizeConfig config, IDocumentReaderCompletion completion) Use this method to process single or multiple images (e.g.voidrecognizeImage(Image image, IDocumentReaderCompletion completion) Use this method to process sequential images (e.g.booleanremoveDatabase(Context context) Use this method to completely delete documents database from application assetsvoidUse this method to reset all parameters to their default valuesseeRfidScenariodescriptionvoidrunAutoUpdate(Context context, String databaseID, IDocumentReaderPrepareCompletion completion) Deprecated.voidrunAutoUpdate(Context context, String databaseID, IDocumentReaderPrepareDbCompletion completion) Use this method to download the latest document description database internet permission requiredvoidsetDeviceConfig(RegDeviceConfigType[] deviceConfig) voidsetEnableCoreLogs(Boolean enableLogs) function to enable core and api logsvoidvoidsetOnClickListener(View.OnClickListener onClickListener) Set click listener for buttons from the UI customization layervoidsetTccParams(TccParams tccParams, ITccParamsCompletion completion) Set up TCC paramsvoidsetVideoEncoderCompletion(IVideoEncoderCompletion completion) Set completion to this method when you want to receive with video file of current sessionvoidshowScanner(Context context, ScannerConfig config, IDocumentReaderCompletion completion) Deprecated.voidUse this method to let DocumentReader know, that new page of the same document will be processedvoidUse this method to let DocumentReader know, that it should perform cleanup of previous resultsvoidstartRFIDReader(Context context, IRfidReaderCompletion completion) Use this method to open RFID chip reading activity, which will take care of detecting and reading chip using NFCvoidstartRFIDReader(Context context, IRfidReaderCompletion completion, IRfidReaderRequest request) Use this method to open RFID chip reading activity, which will take care of detecting and reading chip using NFCvoidstartRFIDReader(Context context, RfidConfig config, IRfidReaderCompletion completion) Use this method to open RFID chip reading activity, which will take care of detecting and reading chip using NFCvoidstartRFIDReader(Context context, RfidConfig config, IRfidReaderCompletion completion, IRfidReaderRequest request) Use this method to open RFID chip reading activity, which will take care of detecting and reading chip using NFCvoidstartScanner(Context context, ScannerConfig config, IDocumentReaderCompletion completion) Use this method to open camera preview activity using specified camera, which will take care of passing frames to recognition engine and return results when readyvoidstopRFIDReader(Context context) Use this method to reg_close RFID chip reading activityvoidstopScanner(Context context) Use this method to reg_close camera preview activity
-
Field Details
-
availableScenarios
List of supported processing scenarios -
version
Detailed information about initialized DocumentReader instance, seeDocReaderVersionfor more details -
tag
session id -
tenant
Customer name -
env
Environment type
-
-
Method Details
-
Instance
This method returns a single instance of DocumentReader class -
processParams
seeProcessParamdescription -
license
seeLicensedescription -
customization
seeParamsCustomizationdescription -
functionality
seeFunctionalitydescription -
rfidScenario
seeRfidScenariodescription -
isReady
public boolean isReady()Use this method, to check if document reader is ready to work- Returns:
- true or false flag, indicating document reader is set up and ready
-
getStatus
Use this method to receive document reader status- Returns:
- string representation of document reader status
-
isRFIDAvailableForUse
public boolean isRFIDAvailableForUse()Allows you to check if native RFID chip reading can be performed based on your license and Core framework capabilities- Returns:
- true if native RFID chip reading is supported
-
isAuthenticatorRFIDAvailableForUse
public boolean isAuthenticatorRFIDAvailableForUse()Allows you to check if you can use external Regula Bluetooth devices based on your license, available scenarios and Core framework capabilities- Returns:
- true if external Regula Bluetooth is supported
-
isAuthenticatorAvailableForUse
public boolean isAuthenticatorAvailableForUse()Use this to check if Mobile authenticator available for use- Returns:
- true if available
-
initializeReader
public void initializeReader(Context context, BleDeviceConfig config, IDocumentReaderInitCompletion completion) Performs the resource loading and overall initialization of Document Reader instance asynchronously- Parameters:
context- Application's contextconfig- Configuration structure instance, containing initialization parameters for BLE devicecompletion- callback
-
initializeReader
public void initializeReader(Context context, DocReaderConfig config, IDocumentReaderInitCompletion completion) Performs the resource loading and overall initialization of Document Reader instance asynchronously The initialization is performed fully offline, although by default the SDK attempts to access the licensing server to keep your license updated. In this case it will require INTERNET permission- Parameters:
context- Application's contextconfig- Configuration structure instance, containing initialization parameterscompletion- callback
-
startNewSession
public void startNewSession()Use this method to let DocumentReader know, that it should perform cleanup of previous results -
finalizePackage
-
endBackendTransaction
public void endBackendTransaction() -
startNewPage
public void startNewPage()Use this method to let DocumentReader know, that new page of the same document will be processed -
recognize
Use this method to process single or multiple images (e.g. from gallery)- Parameters:
config-RecognizeConfigcontains a scenarioScenarioorOnlineProcessingConfigand image/imagescompletion- callback
-
recognize
public void recognize(Context context, RecognizeConfig config, IDocumentReaderCompletion completion) Use this method to process single or multiple images (e.g. from gallery) and perform manual crop for single image- Parameters:
context- to run manual crop Activityconfig-RecognizeConfigcontains a scenarioScenarioorOnlineProcessingConfigand image/imagescompletion- callback
-
recognizeImage
Use this method to process sequential images (e.g. camera video preview sequential frames)- Parameters:
image- Image contains a frame from ImageReader#acquireLatestImage() that returned callback ImageReader.OnImageAvailableListener for Camera2 APIcompletion- callback
-
startScanner
public void startScanner(Context context, ScannerConfig config, IDocumentReaderCompletion completion) Use this method to open camera preview activity using specified camera, which will take care of passing frames to recognition engine and return results when ready- Parameters:
context- The Context in which this PendingIntent should startconfig-ScannerConfigcontains a scenarioScenarioand ID of the camera to be used for video capturingcompletion- callback
-
showScanner
@Deprecated public void showScanner(Context context, ScannerConfig config, IDocumentReaderCompletion completion) Deprecated.UsestartScanner(Context, ScannerConfig, IDocumentReaderCompletion)()}} instead -
stopScanner
public void stopScanner(Context context) Use this method to reg_close camera preview activity -
readRFID
Use this method, to read data from detected chip using NFC- Parameters:
tag- detected NFC objectcompletion- callback
-
readRFID
Use this method, to read data from detected chip using NFC- Parameters:
tag- detected NFC objectcompletion- callbackrequest- callback
-
startRFIDReader
Use this method to open RFID chip reading activity, which will take care of detecting and reading chip using NFC- Parameters:
context- context to start RFID readercompletion- callback
-
startRFIDReader
Use this method to open RFID chip reading activity, which will take care of detecting and reading chip using NFC- Parameters:
context- context to start RFID readerconfig- configuration of rfid reader, seeRfidConfigcompletion- callback
-
startRFIDReader
public void startRFIDReader(Context context, IRfidReaderCompletion completion, IRfidReaderRequest request) Use this method to open RFID chip reading activity, which will take care of detecting and reading chip using NFC- Parameters:
context- context to start RFID readercompletion- callbackrequest- request certificates callback
-
startRFIDReader
public void startRFIDReader(Context context, RfidConfig config, IRfidReaderCompletion completion, IRfidReaderRequest request) Use this method to open RFID chip reading activity, which will take care of detecting and reading chip using NFC- Parameters:
context- context to start RFID readerconfig- configuration of rfid reader, seeRfidConfigcompletion- callbackrequest- request certificates callback
-
stopRFIDReader
public void stopRFIDReader(Context context) Use this method to reg_close RFID chip reading activity -
checkDatabaseUpdate
public void checkDatabaseUpdate(Context context, String databaseId, ICheckDatabaseUpdate completion) Use this method to check database update internet permission required- Parameters:
databaseId- Database to be checkedcompletion- callback
-
prepareDatabase
public void prepareDatabase(Context context, String databaseID, IDocumentReaderPrepareDbCompletion completion) Use this method to check if document description database is present and download it, if not- Parameters:
databaseID- Database to be checkedcompletion- callback
-
prepareDatabase
@Deprecated public void prepareDatabase(Context context, String databaseID, IDocumentReaderPrepareCompletion completion) Deprecated.Use this method to check if document description database is present and download it, if not- Parameters:
databaseID- Database to be checkedcompletion- callback
-
removeDatabase
public boolean removeDatabase(Context context) Use this method to completely delete documents database from application assets- Parameters:
context- current context- Returns:
trueif and only if the database was removed
-
runAutoUpdate
@Deprecated public void runAutoUpdate(Context context, String databaseID, IDocumentReaderPrepareCompletion completion) Deprecated.Use this method to download the latest document description database internet permission required- Parameters:
databaseID- Database to be updatedcompletion- callback
-
runAutoUpdate
public void runAutoUpdate(Context context, String databaseID, IDocumentReaderPrepareDbCompletion completion) Use this method to download the latest document description database internet permission required- Parameters:
databaseID- Database to be updatedcompletion- callback
-
cancelDBUpdate
public boolean cancelDBUpdate(Context context) Use this method to cancel downloading the document description database- Returns:
trueif and only if the update database was cancelledfalsereturns when db update is not started yet.
-
setEnableCoreLogs
function to enable core and api logs- Parameters:
enableLogs- true for enable logs
-
addPKDCertificates
function which pass Rfid certificates to Core- Parameters:
certificates- list of certificates
-
clearPKDCertificates
public void clearPKDCertificates()function which clear all certificates in Core -
createPerson
Use this method to create a persona on the backend -
deinitializeReader
public void deinitializeReader()Use this method to unload the Document Reader and free used resources -
resetConfiguration
public void resetConfiguration()Use this method to reset all parameters to their default values -
setVideoEncoderCompletion
Set completion to this method when you want to receive with video file of current session- Parameters:
completion- callback, see moreIVideoEncoderCompletion
-
setOnClickListener
public void setOnClickListener(View.OnClickListener onClickListener) Set click listener for buttons from the UI customization layer- Parameters:
onClickListener- callback, see more View.OnClickListener
-
getVideoCaptureSessionId
Method to get current video capture session id- Returns:
- returns guid as string
-
setTccParams
Set up TCC params- Parameters:
tccParams- input paramscompletion- completion block
-
setDeviceConfig
-
getDeviceConfig
-
setLocale
-
getLocale
-