Anyline SDK v43 (New Changes and Upgrade Guide) - Android

 


New and Improved!

Our Engineers have meticulously rewritten our Anyline Android SDK from the ground up with Version 43. Here you will experience a wide array of game changing features, performance enhancements and overall ease-of-use improvements.

This article covers a summary of what v43 offers compared to our previous versions, a video guide on how to upgrade from any previous version of our Anyline Android SDK to v43, links to the documentation, and a glossary of some of the terminology associated with our SDK.


Before and After

Previous versions of Anyline SDK

Version 43 of Anyline SDK

 


Changes in Version 43

Anyline Android SDK previous versions

Implementing a scan module requires the following classes to be initialized:

  1. a scan view

  2. a scan view plugin

  3. a scan plugin

the second and third class specify the scanning module you have selected.
For example:
OCR → OcrScanViewPlugin AnylineOcrConfig

In Android, the ScanPlugin is initialized internally (in the SDK) once the ScanViewPlugin is initialized.

 

Example:

@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // This must be called before doing anything Anyline-related! // Try/Catch this to check whether or not your license key is valid! try { AnylineSDK.init(getString(R.string.anyline_license_key), this); } catch (LicenseException e) { // handle exception } // Get the view from the layout setContentView(R.layout.activity_anyline_scan_view); // initialise the scanView scanView = (ScanView) findViewById(R.id.scan_view); //init the scanViewPlugin configuration which hold the scan view ui configuration (cutoutConfig and ScanFeedbackConfig) ScanViewPluginConfig licensePlateScanViewPluginConfig = new ScanViewPluginConfig(getApplicationContext(), "license_plate_view_config.json"); //init the scanViewPlugin LicensePlateScanViewPlugin scanViewPlugin = new LicensePlateScanViewPlugin(getApplicationContext(), licensePlateScanViewPluginConfig, "LICENSE_PLATE"); //init the base scanViewConfig which hold camera and flash configuration BaseScanViewConfig licensePlateBaseScanViewConfig = new BaseScanViewConfig(getApplicationContext(), "license_plate_view_config.json"); //set the base scanViewConfig to the ScanView scanView.setScanViewConfig(licensePlateBaseScanViewConfig); //set the scanViewPlugin to the ScanView scanView.setScanViewPlugin(scanViewPlugin); //add result listener scanViewPlugin.addScanResultListener((ScanResultListener<LicensePlateScanResult>) result -> Log.d("Main Activity", "The scanned result is: " + result.getResult())); }
  • cancelOnResult is a required field and is either true or false. id should be a valid keyword string and is a required field. viewPlugins is an array where the viewPlugin JSON bodies of each child plugin is listed.

Example:

{ "serialViewPluginComposite": { "id": "CATTLE_DL_VIN", "cancelOnResult": true, "viewPlugins": [ { "viewPlugin": { "plugin": { "id": "CATTLE_TAG", "ocrPlugin": { "cattleTagConfig": {} } }, ... } }, { "viewPlugin": { "plugin": { "id": "DRIVING_LICENSE", "idPlugin": { ... } }, ... } ] } }

 

 

  • Previous config files are parsed with the top-level keys identified as the objects they represent.

  • For example: The JSON configuration for the camera on a device is under the key identifier, camera ; the JSON configuration for the flash of the camera is under the key identifier, flash, and so on.

  • The cancelOnResult method is found inside the viewPlugin

Example:

{ "viewPlugin": { "plugin": { "id": "LICENSEPLATE_PLUGIN", "licensePlatePlugin": { "scanMode": "AUTO" } }, "cutoutConfig" : { "style": "rect", "maxWidthPercent": "70%", "maxHeightPercent": "70%", "alignment": "top_half", "ratioFromSize": { "width": 3, "height": 1 }, "outerColor": "000000", "outerAlpha": 0.3, "strokeWidth": 1, "strokeColor": "FFFFFF", "cornerRadius": 2, "feedbackStrokeColor": "0099FF" }, "scanFeedback": { "animation": "none", "animationDuration" : 250, "style": "rect", "strokeWidth": 2, "strokeColor": "0099FF", "beepOnResult": true, "vibrateOnResult": true, "blinkAnimationOnResult": true }, "cancelOnResult" : true } }

The ScanPlugin, ScanViewPlugin, and ScanView Listeners all require the implementation different listeners for specific modules.

Some module specific delegate examples are OcrScanResult, LicensePlateScanResult, and so on.

ScanResult does not support strongly-typed result types of modules and are not defined as part of the result object.

Anyline Android SDK v43

 


Upgrading to v43

To watch the video tutorial, please click here.

 


Other Additions

 


 


Glossary