Class ScanbotBarcodeScannerSDKInitializer
-
- All Implemented Interfaces:
-
io.scanbot.sdk.ScanbotSdkInitializerCommonApi,io.scanbot.sdk.SdkInitializer
public final class ScanbotBarcodeScannerSDKInitializer implements SdkInitializer, ScanbotSdkInitializerCommonApi<ScanbotBarcodeScannerSDKInitializer>
Initializes Scanbot SDK library. Use it to set up desired components and then call initialize.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classScanbotBarcodeScannerSDKInitializer.Companion
-
Field Summary
Fields Modifier and Type Field Description public final static ScanbotBarcodeScannerSDKInitializer.CompanionCompanion
-
Constructor Summary
Constructors Constructor Description ScanbotBarcodeScannerSDKInitializer()
-
Method Summary
Modifier and Type Method Description ScanbotBarcodeScannerSDKInitializerwithLogging(Boolean useLog, Boolean enableNativeLogging)Enables or disables logs in Scanbot SDK. final ScanbotBarcodeScannerSDKInitializerlicense(Application application, String license)Set Scanbot Barcode Scanner SDK license. final ScanbotBarcodeScannerSDKInitializerlicenceErrorHandler(IScanbotSDKLicenseErrorHandler licenseErrorHandler)Register callback for handling all sdk license errors after sdk initialisation. final ScanbotBarcodeScannerSDKInitializerallowXnnpackAcceleration(Boolean enable)Enables/disables XNNPACK acceleration for TensorFlow ML models, which provides highly optimized implementations of floating-point neural network operators. final ScanbotBarcodeScannerSDKInitializerallowGpuAcceleration(Boolean enable)Enables/disables GPU acceleration for TensorFlow ML models. final ScanbotBarcodeScannerSDKInitializerprecompileGpuMlModels(Function0<Unit> precompilingCallback)Performs GPU ML models pre-compiling. SdkLicenseInfoinitialize(Application application)Initializes Scanbot SDK library. final ScanbotBarcodeScannerSDKInitializersdkFilesDirectory(Application application, File sdkFilesDirectory)Set the custom directory for pages and documents storage. final ScanbotBarcodeScannerSDKInitializeruseFileEncryption(Boolean enableFileEncryption, FileIOProcessor fileIOProcessor)Sets a global Scanbot Barcode Scanner SDK flag which enables/disables a usage of encrypted file IO processor for all image and pdf files. ScanbotBarcodeScannerSDKInitializeruseCameraXRtuUi(Boolean enable)Controls whether the new Camera X based View will be used in Ready to Use UI components. final ScanbotBarcodeScannerSDKInitializerpdfImagesExtractorType(PdfImagesExtractor.Type type)Set Scanbot SDK to use the specified io.scanbot.sdk.pdf.PdfImagesExtractor.Type. ScanbotBarcodeScannerSDKInitializerlogger(Logger logger)Adjust this parameter to specify which Logger should be used. static BooleanisInitialized()Check if Scanbot SDK was initialized. -
-
Method Detail
-
withLogging
ScanbotBarcodeScannerSDKInitializer 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-trueto enable logging,falseto disable loggingenableNativeLogging- settrueif logging in C++ native core should be enabled.
-
license
final ScanbotBarcodeScannerSDKInitializer license(Application application, String license)
Set Scanbot Barcode Scanner SDK license.
-
licenceErrorHandler
final ScanbotBarcodeScannerSDKInitializer licenceErrorHandler(IScanbotSDKLicenseErrorHandler licenseErrorHandler)
Register callback for handling all sdk license errors after sdk initialisation.
-
allowXnnpackAcceleration
final ScanbotBarcodeScannerSDKInitializer allowXnnpackAcceleration(Boolean enable)
Enables/disables XNNPACK acceleration for TensorFlow ML models, which provides highly optimized implementations of floating-point neural network operators.
-
allowGpuAcceleration
final ScanbotBarcodeScannerSDKInitializer allowGpuAcceleration(Boolean enable)
Enables/disables GPU acceleration for TensorFlow ML models.
-
precompileGpuMlModels
final ScanbotBarcodeScannerSDKInitializer precompileGpuMlModels(Function0<Unit> precompilingCallback)
Performs GPU ML models pre-compiling.
- Parameters:
precompilingCallback- this callback will be triggered when GPU ML models compilation will be completed.
-
initialize
SdkLicenseInfo initialize(Application application)
Initializes Scanbot SDK library. Can be called only once.
-
sdkFilesDirectory
final ScanbotBarcodeScannerSDKInitializer sdkFilesDirectory(Application application, File sdkFilesDirectory)
Set the custom directory for pages and documents storage.
-
useFileEncryption
final ScanbotBarcodeScannerSDKInitializer useFileEncryption(Boolean enableFileEncryption, FileIOProcessor fileIOProcessor)
Sets a global Scanbot Barcode Scanner SDK flag which enables/disables a usage of encrypted file IO processor for all image and pdf files.
By default -
false.
-
useCameraXRtuUi
ScanbotBarcodeScannerSDKInitializer useCameraXRtuUi(Boolean enable)
Controls whether the new Camera X based View will be used in Ready to Use UI components.
trueby default.
-
pdfImagesExtractorType
final ScanbotBarcodeScannerSDKInitializer 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 ScanbotBarcodeScannerSDK.createPdfImagesExtractor to get an instance of PdfImagesExtractor
-
logger
ScanbotBarcodeScannerSDKInitializer logger(Logger logger)
Adjust this parameter to specify which Logger should be used. To set a custom logger withLogging must be set to
true.- Parameters:
logger- implementation of Logger.
-
isInitialized
static Boolean isInitialized()
Check if Scanbot SDK was initialized.
-
-
-
-