Deprecation warning
Please note that this is outdated documentation for an older release of the Scandit Barcode Scanner SDK.
We are deprecating the 5.x API on all platforms (except Linux). Release 5.19 in April 2021 will be our final. Applications running 5.x will continue to work, and we will continue to release critical bug fixes and security patches only, for one year. We encourage you to migrate to 6.x and take advantage of our latest / advanced features and improved performance.
You'll find the updated documentation at: Data Capture SDK Documentation for Android
Public Member Functions | |
void | didScan (ScanditSDKScanSession session) |
Detailed Description
Interface definition for a callback to be invoked when one or more barcodes were recognized.
As of 4.3, the ScanditSDKOnScanListener replaces the ScanditSDKListener.
Member Function Documentation
void didScan | ( | ScanditSDKScanSession | session | ) |
Called whenever a new barcode has been successfully decoded.
Newly decoded codes are available as ScanditSDKScanSession.getNewlyDecodedCodes(). When didScan callback is invoked, there is always at least one new code available.
The callback is invoked in the thread running the barcode recognition engine. This means, any change to the graphical user interface will have to be moved to the UI thread. Likewise, Since the callback blocks the engine, any expensive calculation should be posted to a Handler.
When no more codes should be scanned, call ScanditSDKScanSession.stopScanning, when the scan session should be paused, call ScanditSDKScanSession.pauseScanning. Calling these two methods is preferred over calling ScanditSDK.stopScanning and ScanditSDK.pauseScanning, as it will immediately stop/pause the scanning.
Note, it is only safe to access the session object inside the didScan callback, but you can safely store the lists of barcodes returned by ScanditSDKScanSession.getAllCodes and ScanditSDKScanSession.getNewlyDecodedCodes
- Parameters
-
session current scan session
- See also
- com.mirasense.scanditsdk.ScanditSDKScanSettings.setCodeDuplicateFilter(int)
- com.mirasense.scanditsdk.ScanditSDKScanSettings.setCodeCachingDuration(int)
The documentation for this interface was generated from the following file:
- ScanditSDKOnScanListener.java