How to Upgrade
From Version 9.x to 10.x
Dynamsoft Barcode Reader SDK has been refactored to integrate with DynamsoftCaptureVision (DCV)
architecture. To upgrade from version 9.x or earlier to 10.x, we recommend you to follow the User Guide and re-write your codes.
Update the Libraries to 10.x Version
The Dynamsoft Barcode Reader SDK has been split into multiple libraries from the previous single library, and the dependency configuration in the app\build.gradle
file needs to be updated accordingly.
-
Local Dependency Put the following
aar
files intolibs
directory and updateapp\build.gradle
file:DynamsoftCaptureVisionRouter.aar
DynamsoftBarcodeReader.aar
DynamsoftImageProcessing.aar
DynamsoftCore.aar
DynamsoftLicense.aar
-
DynamsoftCameraEnhancer.aar
(optional)dependencies { implementation fileTree(include: ['*.aar'], dir: 'libs') }
-
Remote Dependency(Maven) update
app\build.gradle
file:dependencies { implementation 'com.dynamsoft:dynamsoftbarcodereaderdundle:{version-number}' }
Note: Please view user guide for the correct version number.
Update the License Activation Code
Starting from 10.0, we have unified the API for setting licenses across different Dynamsoft products.
Old APIs | New APIs |
---|---|
BarcodeReader.initLicense |
LicenseManager.initLicense |
- Java code in 9.x:
BarcodeReader.initLicense("Put your license", new DBRLicenseVerificationListener() {
@Override
public void DBRLicenseVerificationCallback(boolean isSuccess, Exception error) {
if(!isSuccess){
error.printStackTrace();
}
}
});
- Java code in 10.x:
LicenseManager.initLicense("Put your license", this, new LicenseVerificationListener() {
@Override
public void onLicenseVerified(boolean isSuccess, Exception error) {
if(!isSuccess){
error.printStackTrace();
}
}
});
Update Single Image Decoding APIs
The APIs for decoding single image has been adjusted as follows:
Old APIs | New APIs |
---|---|
BarcodeReader.decodeFile |
CaptureVisionRouter.capture(String filePath, String templateName) |
BarcodeReader.decodeFileInMemory |
CaptureVisionRouter.capture(byte[] fileBytes, String templateName) |
BarcodeReader.decodeBuffer |
CaptureVisionRouter.capture(ImageData imageData, String templateName) |
BarcodeReader.decodeBufferedImage |
CaptureVisionRouter.capture(Bitmap bitmap, String templateName) |
class TextResult |
class BarcodeResultItem |
BarcodeReader.decodeBase64String |
Currently not available. |
Update Video Streaming Decoding APIs
The APIs for decoding video frames has been adjusted as follows:
Old APIs | New APIs |
---|---|
BarcodeReader.setImageSource |
CaptureVisionRouter.setInput |
BarcodeReader.startScanning |
CaptureVisionRouter.startCapturing |
BarcodeReader.stopScanning |
CaptureVisionRouter.stopCapturing |
BarcodeReader.setTextResultListener |
CaptureVisionRouter.addResultReceiver |
BarcodeReader.setIntermediateResultListener |
CaptureVisionRouter.IntermediateResultManager.addResultReceiver |
BarcodeReader.set/getMinImageReadingInterval |
SimplifiedCaptureVisionSettings.minImageCaptureInterval |
BarcodeReader.enableResultVerification |
MultiFrameResultCrossFilter.enableResultCrossVerification |
BarcodeReader.enableDuplicateFilter |
MultiFrameResultCrossFilter.enableResultDeduplication |
interface ImageSource |
interface ImageSourceAdapter |
interface TextResultListener |
interface CapturedResultReceiver |
interface IntermediateResultListener |
interface IntermediateResultReceiver |
class TextResult |
class BarcodeResultItem |
Migrate Your Templates
The template system is upgraded. The template you used for the previous version can’t be directly recognized by the new version. Please download the TemplateConverter tool or contact us to upgrade your template.
The template-based APIs have been updated as follows:
Old APIs | New APIs |
---|---|
BarcodeReader.initRuntimeSettingsWithFile |
CaptureVisionRouter.initSettingsFromFile |
BarcodeReader.initRuntimeSettingsWithString |
CaptureVisionRouter.initSettings |
BarcodeReader.outputSettingsToFile |
CaptureVisionRouter.outputSettingsToFile |
BarcodeReader.outputSettingsToString |
CaptureVisionRouter.outputSettings |
BarcodeReader.resetRuntimeSettings |
CaptureVisionRouter.resetSettings |
BarcodeReader.appendTplFileToRuntimeSettings |
Not available. |
BarcodeReader.appendTplStringToRuntimeSettings |
Not available. |
Migrate Your PublicRuntimeSettings
The class PublicRuntimeSettings
has been refactored. It retains commonly used properties while removing the previously complex property settings, which are now exclusively supported through templates.
The APIs for accessing and updating PublicRuntimeSettings
has been adjusted as follows:
Old APIs | New APIs |
---|---|
BarcodeReader.getRuntimeSettings |
CaptureVisionRouter.getSimplifiedSettings |
BarcodeReader.updateRuntimeSettings |
CaptureVisionRouter.updateSettings |
Migrate to SimplifiedCaptureVisionSettings
The following properties are replaced by similar properties under SimplifiedCaptureVisionSettings
. They can also be set via a template file(String).
PublicRuntimeSettings Property | SimplifiedCaptureVisionSettings Property | Template File Parameter |
---|---|---|
region |
roi & roiMeasuredInPercentage |
TargetROIDef.Location.Offset |
timeout |
timeout |
CaptureVisionTemplates.Timeout |
Migrate to SimplifiedBarcodeReaderSettings
The following properties are replaced by similar properties under SimplifiedBarcodeReaderSettings
. The majority of them can also be set via a template file(String).
PublicRuntimeSettings Property | SimplifiedBarcodeReaderSettings Property | Template File Parameter |
---|---|---|
minBarcodeTextLength |
minBarcodeTextLength |
BarcodeFormatSpecification.BarcodeTextLengthRangeArray |
minResultConfidence |
minResultConfidence |
BarcodeFormatSpecification.MinResultConfidence |
localizationModes |
localizationModes |
BarcodeReaderTaskSetting.LocationModes |
expectedBarcodesCount |
expectedBarcodesCount |
BarcodeReaderTaskSetting.ExpectedBarcodesCount |
barcodeFormatIds |
barcodeFormatIds |
BarcodeReaderTaskSetting.BarcodeFormatIds |
barcodeFormatIds_2 |
barcodeFormatIds |
BarcodeReaderTaskSetting.BarcodeFormatIds |
deblurModes |
deblurModes |
BarcodeReaderTaskSetting.DeblurModes |
deblurLevel |
deblurModes |
BarcodeReaderTaskSetting.DeblurModes |
maxAlgorithmThreadCount |
maxThreadsInOneTask |
BarcodeReaderTaskSetting.MaxThreadsInOneTask |
Remarks:
- The 2 groups of barcode formats are merged.
DeblurLevel
is deprecated. You can useDeblurModes
instead.
FurtherModes Property | SimplifiedBarcodeReaderSettings Property | Template File Parameter |
---|---|---|
grayscaleTransformationModes |
grayscaleTransformationModes |
ImageParameter.GrayscaleTransformationModes |
imagePreprocessingModes |
grayscaleEnhancementModes |
ImageParameter.GrayscaleEnhancementModes |
scaleDownThreshold |
scaleDownThreshold |
ImageParameter.ScaleDownThreshold |
Remarks: The mode
IPM_MORPHOLOGY
ofimagePreprocessingModes
is migrated toBinarizationModes
. The mode argumentsMorphOperation
,MorphOperationKernelSizeX
,MorphOperationKernelSizeY
,MorphShape
are now available for all modes ofBinarizationModes
.
Migrate to Template File
The following properties can only be set via a template file. Please contact us so that we can help you to transform your current settings to a new template file.
PublicRuntimeSettings Property | Template File Parameter |
---|---|
binarizationModes |
ImageParameter.BinarizationModes |
textResultOrderModes |
BarcodeReaderTaskSetting.TextResultOrderModes |
returnBarcodeZoneClarity |
BarcodeReaderTaskSetting.ReturnBarcodeZoneClarity |
scaleUpModes |
ImageParameter.ScaleUpModes |
barcodeZoneMinDistanceToImageBorders |
BarcodeFormatSpecification.BarcodeZoneMinDistanceToImageBorders |
terminatePhase |
BarcodeReaderTaskSetting.TerminateSettings |
PublicRuntimeSettings.furtherModes Property | Template File Parameter |
---|---|
colourConversionModes |
ImageParameter.ColourConversionModes |
regionPredetectionModes |
ImageParameter.RegionPredetectionModes |
textureDetectionModes |
ImageParameter.TextureDetectionModes |
textFilterModes |
ImageParameter.TextDetectionMode & ImageParameter.IfEraseTextZone |
dpmCodeReadingModes |
BarcodeReaderTaskSetting.DPMCodeReadingModes |
deformationResistingModes |
BarcodeReaderTaskSetting.DeformationResistingModes |
barcodeComplementModes |
BarcodeReaderTaskSetting.BarcodeComplementModes |
barcodeColourModes |
BarcodeReaderTaskSetting.BarcodeColourModes |
Migrate to Other APIs
The Intermediate Result
system is redesigned and the following properties are deprecated.
PublicRuntimeSettings Property |
---|
intermediateResultTypes |
intermediateResultSavingMode |
Removed
The following properties are removed.
PublicRuntimeSettings Property |
---|
resultCoordinateType |
FurtherModes Property |
---|
colourClusteringModes |