Class 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 Detail

      • availableScenarios

        public java.util.List<DocumentReaderScenario> availableScenarios
        List of supported processing scenarios
      • tag

        public java.lang.String tag
        session id
      • tenant

        public java.lang.String tenant
        Customer name
      • env

        public java.lang.String env
        Environment type
    • Method Detail

      • Instance

        public static DocumentReader Instance()
        This method returns a single instance of DocumentReader class
      • 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()
        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 context
        config - Configuration structure instance, containing initialization parameters for BLE device
        completion - 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 context
        config - Configuration structure instance, containing initialization parameters
        completion - callback
      • startNewSession

        public void startNewSession()
        Use this method to let DocumentReader know, that it should perform cleanup of previous results
      • 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
      • showScanner

        public void showScanner​(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 start
        config - ScannerConfig contains a scenario Scenario and ID of the camera to be used for video capturing
        completion - callback
      • stopScanner

        public void stopScanner​(Context context)
        Use this method to reg_close camera preview activity
      • readRFID

        public void readRFID​(IsoDep tag,
                             IRfidCompletion completion)
        Use this method, to read data from detected chip using NFC
        Parameters:
        tag - detected NFC object
        completion - callback
      • readRFID

        public void readRFID​(IsoDep tag,
                             IRfidCompletion completion,
                             IRfidReaderRequest request)
        Use this method, to read data from detected chip using NFC
        Parameters:
        tag - detected NFC object
        completion - callback
        request - callback
      • startRFIDReader

        public void startRFIDReader​(Context context,
                                    IRfidReaderCompletion completion)
        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 reader
        completion - callback
      • startRFIDReader

        public void startRFIDReader​(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 NFC
        Parameters:
        context - context to start RFID reader
        config - configuration of rfid reader, see RfidConfig
        completion - 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 reader
        completion - callback
        request - 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 reader
        config - configuration of rfid reader, see RfidConfig
        completion - callback
        request - 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,
                                        java.lang.String databaseId,
                                        ICheckDatabaseUpdate completion)
        Use this method to check database update internet permission required
        Parameters:
        databaseId - Database to be checked
        completion - callback
      • prepareDatabase

        public void prepareDatabase​(Context context,
                                    java.lang.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 checked
        completion - callback
      • prepareDatabase

        @Deprecated
        public void prepareDatabase​(Context context,
                                    java.lang.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 checked
        completion - 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

        @Deprecated
        public void runAutoUpdate​(Context context,
                                  java.lang.String databaseID,
                                  IDocumentReaderPrepareCompletion completion)
        Deprecated.
        Use this method to download the latest document description database internet permission required
        Parameters:
        databaseID - Database to be updated
        completion - callback
      • runAutoUpdate

        public void runAutoUpdate​(Context context,
                                  java.lang.String databaseID,
                                  IDocumentReaderPrepareDbCompletion completion)
        Use this method to download the latest document description database internet permission required
        Parameters:
        databaseID - Database to be updated
        completion - 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 false returns when db update is not started yet.
      • 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 more IVideoEncoderCompletion
      • 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

        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 params
        completion - completion block