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
Fields Modifier and Type Field Description java.util.List<DocumentReaderScenario>
availableScenarios
List of supported processing scenariosjava.lang.String
tag
session idDocReaderVersion
version
Detailed information about initialized DocumentReader instance, seeDocReaderVersion
for more details
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addPKDCertificates(java.util.List<PKDCertificate> certificates)
function which pass Rfid certificates to Coreboolean
cancelDBUpdate(Context context)
Use this method to cancel downloading the document description databasevoid
checkDatabaseUpdate(Context context, java.lang.String databaseId, ICheckDatabaseUpdate completion)
Use this method to check database update internet permission requiredvoid
clearPKDCertificates()
function which clear all certificates in CoreParamsCustomization
customization()
seeParamsCustomization
descriptionvoid
deinitializeReader()
Use this method to unload the Document Reader and free used resourcesFunctionality
functionality()
seeFunctionality
descriptionRegDeviceConfigType
getDeviceConfig()
java.lang.String
getStatus()
Use this method to receive document reader statusjava.lang.String
getVideoCaptureSessionId()
Method to get current video capture session idvoid
initializeReader(Context context, BleDeviceConfig config, IDocumentReaderInitCompletion completion)
Performs the resource loading and overall initialization of Document Reader instance asynchronouslyvoid
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.static DocumentReader
Instance()
This method returns a single instance of DocumentReader classboolean
isAuthenticatorAvailableForUse()
Use this to check if Mobile authenticator available for useboolean
isReady()
Use this method, to check if document reader is ready to workboolean
isRFIDAvailableForUse()
Use this to check if RFID chip reading functionality is supportedLicense
license()
seeLicense
descriptionvoid
prepareDatabase(Context context, java.lang.String databaseID, IDocumentReaderPrepareCompletion completion)
Use this method to check if document description database is present and download it, if notProcessParam
processParams()
seeProcessParam
descriptionvoid
readRFID(IsoDep tag, IDocumentReaderCompletion completion)
Use this method, to read data from detected chip using NFC Pay attention that `rfidAction` with `DocReaderAction.NOTIFICATION` code calls in background thread.void
readRFID(IsoDep tag, IDocumentReaderCompletion completion, IRfidReaderRequest request)
Use this method, to read data from detected chip using NFC Pay attention that `rfidAction` with `DocReaderAction.NOTIFICATION` code calls in background thread.void
recognizeImage(Bitmap bitmap, IDocumentReaderCompletion completion)
Use this method to process single image (e.g.void
recognizeImage(Context context, byte[] data, IDocumentReaderCompletion completion)
Use this method to process an image in any format and perform manual cropvoid
recognizeImage(Context context, Bitmap bitmap, IDocumentReaderCompletion completion)
Use this method to process single image (e.g.void
recognizeImages(Bitmap[] bitmaps, IDocumentReaderCompletion completion)
Use this method to process multiple imagesboolean
removeDatabase(Context context)
Use this method to completely delete documents database from application assetsvoid
resetConfiguration()
Use this method to reset all parameters to their default valuesRfidScenario
rfidScenario()
seeRfidScenario
descriptionvoid
runAutoUpdate(Context context, java.lang.String databaseID, IDocumentReaderPrepareCompletion completion)
Use this method to download the latest document description database internet permission requiredvoid
setDeviceConfig(RegDeviceConfigType[] deviceConfig)
void
setEnableCoreLogs(java.lang.Boolean enableLogs)
function to enable core and api logsvoid
setTccParams(TccParams tccParams, ITccParamsCompletion completion)
Set up TCC paramsvoid
setVideoEncoderCompletion(IVideoEncoderCompletion completion)
Set completion to this method when you want to receive with video file of current sessionvoid
showScanner(Context context, int cameraId, 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 readyvoid
showScanner(Context context, IDocumentReaderCompletion completion)
Use this method to open camera preview activity using default back camera, which will take care of passing frames to recognition engine and return results when ready from your contextvoid
startNewPage()
Use this method to let DocumentReader know, that new page of the same document will be processedvoid
startNewSession()
Use this method to let DocumentReader know, that it should perform cleanup of previous resultsvoid
startRFIDReader(Context context, IDocumentReaderCompletion completion)
Use this method to open RFID chip reading activity, which will take care of detecting and reading chip using NFC Pay attention that `rfidAction` with `DocReaderAction.NOTIFICATION` code calls in background thread.void
startRFIDReader(Context context, IDocumentReaderCompletion completion, IRfidReaderRequest request)
Use this method to open RFID chip reading activity, which will take care of detecting and reading chip using NFC Pay attention that `rfidAction` with `DocReaderAction.NOTIFICATION` code calls in background thread.void
startRFIDReader(Context context, IDocumentReaderCompletion completion, IRfidReaderRequest request, IRfidNotificationCompletion notificationCompletion)
Use this method to open RFID chip reading activity, which will take care of detecting and reading chip using NFC Pay attention that `rfidAction` with `DocReaderAction.NOTIFICATION` code calls in background thread.void
stopRFIDReader(Context context)
Use this method to reg_close RFID chip reading activityvoid
stopScanner(Context context)
Use this method to reg_close camera preview activity
-
-
-
Field Detail
-
availableScenarios
public java.util.List<DocumentReaderScenario> availableScenarios
List of supported processing scenarios
-
version
public DocReaderVersion version
Detailed information about initialized DocumentReader instance, seeDocReaderVersion
for more details
-
tag
public java.lang.String tag
session id
-
-
Method Detail
-
Instance
public static DocumentReader Instance()
This method returns a single instance of DocumentReader class
-
processParams
public ProcessParam processParams()
seeProcessParam
description
-
customization
public ParamsCustomization customization()
seeParamsCustomization
description
-
functionality
public Functionality functionality()
seeFunctionality
description
-
rfidScenario
public RfidScenario rfidScenario()
seeRfidScenario
description
-
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
public java.lang.String getStatus()
Use this method to receive document reader status- Returns:
- string representation of document reader status
-
isRFIDAvailableForUse
public boolean isRFIDAvailableForUse()
Use this to check if RFID chip reading functionality is supported- Returns:
- true if RFID chip reading is supported using NFC
-
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
-
startNewPage
public void startNewPage()
Use this method to let DocumentReader know, that new page of the same document will be processed
-
recognizeImage
public void recognizeImage(Bitmap bitmap, IDocumentReaderCompletion completion)
Use this method to process single image (e.g. from gallery)- Parameters:
bitmap
- image of document to be processedcompletion
- callback
-
recognizeImage
public void recognizeImage(Context context, byte[] data, IDocumentReaderCompletion completion)
Use this method to process an image in any format and perform manual crop- Parameters:
data
- binary datacompletion
- callback
-
recognizeImages
public void recognizeImages(Bitmap[] bitmaps, IDocumentReaderCompletion completion)
Use this method to process multiple images- Parameters:
bitmaps
- images of documents to be processedcompletion
- callback
-
recognizeImage
public void recognizeImage(Context context, Bitmap bitmap, IDocumentReaderCompletion completion)
Use this method to process single image (e.g. from gallery) and perform manual crop- Parameters:
bitmap
- image of document to be processedcompletion
- callback
-
showScanner
public void showScanner(Context context, IDocumentReaderCompletion completion)
Use this method to open camera preview activity using default back camera, which will take care of passing frames to recognition engine and return results when ready from your context- Parameters:
context
- The Context in which this PendingIntent should startcompletion
- callback
-
showScanner
public void showScanner(Context context, int cameraId, 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 startcameraId
- ID of the camera to be used for video capturingcompletion
- callback
-
stopScanner
public void stopScanner(Context context)
Use this method to reg_close camera preview activity
-
readRFID
public void readRFID(IsoDep tag, IDocumentReaderCompletion completion)
Use this method, to read data from detected chip using NFC Pay attention that `rfidAction` with `DocReaderAction.NOTIFICATION` code calls in background thread.- Parameters:
tag
- detected NFC objectcompletion
- callback
-
readRFID
public void readRFID(IsoDep tag, IDocumentReaderCompletion completion, IRfidReaderRequest request)
Use this method, to read data from detected chip using NFC Pay attention that `rfidAction` with `DocReaderAction.NOTIFICATION` code calls in background thread.- Parameters:
tag
- detected NFC objectcompletion
- callbackrequest
- callback
-
startRFIDReader
public void startRFIDReader(Context context, IDocumentReaderCompletion completion)
Use this method to open RFID chip reading activity, which will take care of detecting and reading chip using NFC Pay attention that `rfidAction` with `DocReaderAction.NOTIFICATION` code calls in background thread.- Parameters:
context
- context to start RFID readercompletion
- callback
-
startRFIDReader
public void startRFIDReader(Context context, IDocumentReaderCompletion completion, IRfidReaderRequest request)
Use this method to open RFID chip reading activity, which will take care of detecting and reading chip using NFC Pay attention that `rfidAction` with `DocReaderAction.NOTIFICATION` code calls in background thread.- Parameters:
context
- context to start RFID readercompletion
- callbackrequest
- request certificates callback
-
startRFIDReader
public void startRFIDReader(Context context, IDocumentReaderCompletion completion, IRfidReaderRequest request, IRfidNotificationCompletion notificationCompletion)
Use this method to open RFID chip reading activity, which will take care of detecting and reading chip using NFC Pay attention that `rfidAction` with `DocReaderAction.NOTIFICATION` code calls in background thread.- Parameters:
context
- A Context of the application package implementing this class.completion
- callbackrequest
- request callback
-
stopRFIDReader
public void stopRFIDReader(Context context)
Use this method to reg_close RFID chip reading activity
-
checkDatabaseUpdate
public void checkDatabaseUpdate(Context context, java.lang.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, java.lang.String databaseID, IDocumentReaderPrepareCompletion completion)
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:
true
if and only if the database was removed
-
runAutoUpdate
public void runAutoUpdate(Context context, java.lang.String databaseID, IDocumentReaderPrepareCompletion 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:
true
if and only if the update database was cancelled
-
setEnableCoreLogs
public void setEnableCoreLogs(java.lang.Boolean enableLogs)
function to enable core and api logs- Parameters:
enableLogs
- true for enable logs
-
addPKDCertificates
public void addPKDCertificates(java.util.List<PKDCertificate> certificates)
function which pass Rfid certificates to Core- Parameters:
certificates
- list of certificates
-
clearPKDCertificates
public void clearPKDCertificates()
function which clear all certificates in Core
-
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
public void setVideoEncoderCompletion(IVideoEncoderCompletion completion)
Set completion to this method when you want to receive with video file of current session- Parameters:
completion
- callback, see moreIVideoEncoderCompletion
-
getVideoCaptureSessionId
public java.lang.String getVideoCaptureSessionId()
Method to get current video capture session id- Returns:
- returns guid as string
-
setTccParams
public void setTccParams(TccParams tccParams, ITccParamsCompletion completion)
Set up TCC params- Parameters:
tccParams
- input paramscompletion
- completion block
-
setDeviceConfig
public void setDeviceConfig(RegDeviceConfigType[] deviceConfig)
-
getDeviceConfig
public RegDeviceConfigType getDeviceConfig()
-
-