Class ScanbotSDKInitializer
-
- All Implemented Interfaces:
public final class ScanbotSDKInitializer
Initializes Scanbot SDK library. Use it to set up desired components and then call .initialize. Can be initialized only once.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final class
ScanbotSDKInitializer.PrepareBlobsTask
-
Constructor Summary
Constructors Constructor Description ScanbotSDKInitializer()
-
Method Summary
Modifier and Type Method Description final ScanbotSDKInitializer
withLogging(Boolean useLog, Boolean enableNativeLogging)
Enables or disables logs in Scanbot SDK. final ScanbotSDKInitializer
license(Application application, String license)
Set Scanbot SDK license final ScanbotSDKInitializer
licenceErrorHandler(IScanbotSDKLicenseErrorHandler licenseErrorHandler)
Register callback for handling all sdk license errors after sdk initialisation final ScanbotSDKInitializer
ocrBlobsPath(Application application, String ocrBlobsPath)
Set Scanbot SDK OCR blobs path final ScanbotSDKInitializer
prepareOCRLanguagesBlobs(Boolean prepareOCRLanguagesBlobs)
Set Scanbot SDK to prepare OCR languages blobs. final ScanbotSDKInitializer
useOcrSettings(OcrSettings ocrSettings)
Set Scanbot SDK to use given OCR settings final ScanbotSDKInitializer
contourDetectorType(ContourDetector.Type type)
Set Scanbot SDK to use the specified io.scanbot.sdk.core.contourdetector.ContourDetector.TypeDefault is io.scanbot.sdk.core.contourdetector.ContourDetector.Type.ML_BASED. final ScanbotSDKInitializer
useFileEncryption(Boolean enableFileEncryption, FileIOProcessor fileIOProcessor)
Sets a global Scanbot SDK flag which enables/disables a usage of encrypted file IO processor for all image and pdf files. final ScanbotSDKInitializer
allowXnnpackAcceleration(Boolean enable)
Enables/disables XNNPACK acceleration for TensorFlow ML models, which provides highly optimized implementations of floating-point neural network operators. final ScanbotSDKInitializer
useCameraXRtuUi(Boolean enable)
Controls whether the new Camera X based View will be used in Ready to Use UI components. final ScanbotSDKInitializer
allowGpuAcceleration(Boolean enable)
Enables/disables GPU acceleration for TensorFlow ML models final ScanbotSDKInitializer
precompileGpuMlModels(Function0<Unit> precompilingCallback)
Performs GPU ML models precompiling final ScanbotSDKInitializer
pdfImagesExtractorType(PdfImagesExtractor.Type type)
Set Scanbot SDK to use the specified io.scanbot.sdk.pdf.PdfImagesExtractor.TypeDefault is io.scanbot.sdk.pdf.PdfImagesExtractor.Type.ANDROID_PDF_WRITER. final SdkLicenseInfo
initialize(Application application)
Initializes Scanbot SDK library final ScanbotSDKInitializer
documentDraftExtractor(DocumentDraftExtractor extractor)
Adjust this parameter to specify snapped pages should be combined into documents and in which format final ScanbotSDKInitializer
sdkFilesDirectory(Application application, File sdkFilesDirectory)
Set the custom directory for pages and documents storage final ScanbotSDKInitializer
logger(Logger logger)
Adjust this parameter to specify which Logger should be used. final ScanbotSDKInitializer
usePageStorageSettings(PageStorageSettings pageStorageSettings)
Adjust this parameter to specify which io.scanbot.sdk.persistence.PageStorageSettings should be used. final static Boolean
isInitialized()
-
-
Method Detail
-
withLogging
final ScanbotSDKInitializer withLogging(Boolean useLog, Boolean enableNativeLogging)
Enables or disables logs in Scanbot SDK.
Logs are printed into LogCat as well as saved on the device. You can find them in Environment.getExternalStorageDirectory/debug_logs/package_name. Usually it is /sdcard/debug_logs/package_name
By default all logs are disabled. If you're using logging, consider switching it off for production builds for security and performance reasons.
This method must be called before .initialize, so it is possible to change logging settings before initializing the SDK.
- Parameters:
useLog
-true
to enable loggingfalse
to disable loggingenableNativeLogging
- settrue
if logging in C++ native core should be enabled, otherwise -false
.
-
license
final ScanbotSDKInitializer license(Application application, String license)
Set Scanbot SDK license
-
licenceErrorHandler
final ScanbotSDKInitializer licenceErrorHandler(IScanbotSDKLicenseErrorHandler licenseErrorHandler)
Register callback for handling all sdk license errors after sdk initialisation
-
ocrBlobsPath
final ScanbotSDKInitializer ocrBlobsPath(Application application, String ocrBlobsPath)
Set Scanbot SDK OCR blobs path
-
prepareOCRLanguagesBlobs
final ScanbotSDKInitializer prepareOCRLanguagesBlobs(Boolean prepareOCRLanguagesBlobs)
Set Scanbot SDK to prepare OCR languages blobs. Prepares language train data blobs for io.scanbot.sdk.mcrecognizer.MedicalCertificateRecognizer and io.scanbot.sdk.hicscanner.HealthInsuranceCardScanner
-
useOcrSettings
final ScanbotSDKInitializer useOcrSettings(OcrSettings ocrSettings)
Set Scanbot SDK to use given OCR settings
-
contourDetectorType
final ScanbotSDKInitializer contourDetectorType(ContourDetector.Type type)
Set Scanbot SDK to use the specified io.scanbot.sdk.core.contourdetector.ContourDetector.Type
Default is io.scanbot.sdk.core.contourdetector.ContourDetector.Type.ML_BASED.
Use io.scanbot.sdk.ScanbotSDK.createContourDetector to get an instance of io.scanbot.sdk.core.contourdetector.ContourDetector
-
useFileEncryption
final ScanbotSDKInitializer useFileEncryption(Boolean enableFileEncryption, FileIOProcessor fileIOProcessor)
Sets a global Scanbot SDK flag which enables/disables a usage of encrypted file IO processor for all image and pdf files. By default - false.
-
allowXnnpackAcceleration
final ScanbotSDKInitializer allowXnnpackAcceleration(Boolean enable)
Enables/disables XNNPACK acceleration for TensorFlow ML models, which provides highly optimized implementations of floating-point neural network operators. By default - true.
-
useCameraXRtuUi
final ScanbotSDKInitializer useCameraXRtuUi(Boolean enable)
Controls whether the new Camera X based View will be used in Ready to Use UI components. True by default
-
allowGpuAcceleration
final ScanbotSDKInitializer allowGpuAcceleration(Boolean enable)
Enables/disables GPU acceleration for TensorFlow ML models
-
precompileGpuMlModels
final ScanbotSDKInitializer precompileGpuMlModels(Function0<Unit> precompilingCallback)
Performs GPU ML models precompiling
- Parameters:
precompilingCallback
- this callback will be triggered when GPU ML models compilation will be completed
-
pdfImagesExtractorType
final ScanbotSDKInitializer pdfImagesExtractorType(PdfImagesExtractor.Type type)
Set Scanbot SDK to use the specified io.scanbot.sdk.pdf.PdfImagesExtractor.Type
Default is io.scanbot.sdk.pdf.PdfImagesExtractor.Type.ANDROID_PDF_WRITER.
Use io.scanbot.sdk.ScanbotSDK.createPdfImagesExtractor to get an instance of io.scanbot.sdk.pdf.PdfImagesExtractor Or use io.scanbot.sdk.ScanbotSDK.createPdfPagesExtractor to get an instance of io.scanbot.sdk.docprocessing.PdfPagesExtractor
-
initialize
final SdkLicenseInfo initialize(Application application)
Initializes Scanbot SDK library
-
documentDraftExtractor
final ScanbotSDKInitializer documentDraftExtractor(DocumentDraftExtractor extractor)
Adjust this parameter to specify snapped pages should be combined into documents and in which format
- Parameters:
extractor
- algorithm to extract array of io.scanbot.sdk.entity.DocumentDraft from io.scanbot.sdk.entity.SnappingDraft
-
sdkFilesDirectory
final ScanbotSDKInitializer sdkFilesDirectory(Application application, File sdkFilesDirectory)
Set the custom directory for pages and documents storage
-
logger
final ScanbotSDKInitializer logger(Logger logger)
Adjust this parameter to specify which Logger should be used. To set a custom logger ScanbotSDKInitializer.withLogging must be set to
true
- Parameters:
logger
- implementation of Logger
-
usePageStorageSettings
final ScanbotSDKInitializer usePageStorageSettings(PageStorageSettings pageStorageSettings)
Adjust this parameter to specify which io.scanbot.sdk.persistence.PageStorageSettings should be used.
-
isInitialized
final static Boolean isInitialized()
-
-
-
-