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

BarcodePickerExternalActivity Class Reference

Inherits BarcodePickerActivity.

Public Member Functions

void setLicenseValidationListener (LicenseValidationListener listener)
 
void didScan (ScanSession session)
 

Protected Member Functions

ScanSettings settingsFromIntent (Intent intent)
 
void setupScanUIFromIntent (BarcodePicker picker, Intent intent)
 
void buildSuccessResult (Intent resultIntent, ScanSession session)
 
void buildCancelResult (Intent resultIntent)
 

Detailed Description

Barcode Picker Activity that can be configured through an intent by passing an app key as well as a secondary app key.

Sample Usage

The following code shows how to start the BarcodePickerActivity to scan a retail code (UPCA, EAN13, EAN8, UPCE):

Intent launchIntent = new Intent(MyActivity.this, BarcodePickerActivity.class);
launchIntent.putExtra("appKey", "Your Scandit BarcodeScanner App Key Goes Here");
launchIntent.putExtra("secondaryAppKey", "Your secondary Scandit BarcodeScanner App Key Goes Here");
launchIntent.putExtra("enabledSymbologies", new int[] {
Barcode.SYMBOLOGY_EAN13,
Barcode.SYMBOLOGY_EAN8,
Barcode.SYMBOLOGY_UPCA,
Barcode.SYMBOLOGY_UPCE
});
// start activity and listen for result.
startActivityForResult(launchIntent, 42);

Member Function Documentation

◆ settingsFromIntent()

ScanSettings settingsFromIntent ( Intent  intent)
protected

Creates a new scan settings instance to configure the barcode picker.

You may override this method to further customize the scan settings to meet your specific use-case.

Parameters
intentthe intent used to start this activity.
Returns

Reimplemented from BarcodePickerActivity.

◆ setLicenseValidationListener()

void setLicenseValidationListener ( LicenseValidationListener  listener)

Register a license validation listener for this barcode picker activity.

LicenseValidationListener.failedToValidateLicense(String) is invoked on the registered listener whenever license validation fails. The possible reasons for the method to be called can be e.g. license expiration or missing API key.

Parameters
listenerthe listener to register
Since
5.8.0

Reimplemented from BarcodePickerActivity.

◆ setupScanUIFromIntent()

void setupScanUIFromIntent ( BarcodePicker  picker,
Intent  intent 
)
protectedinherited

Uses the configuration options in the intent to setup the scan UI.

You can override this method to further customize the scan UI.

Parameters
pickerthe picker to configure.
intentthe intent used to launch the activity.

◆ didScan()

void didScan ( ScanSession  session)
inherited

Called whenever a new barcode has been successfully recognized.

Newly recognized codes are available as ScanSession.getNewlyRecognizedCodes(). 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 ScanSession.stopScanning, when the scan session should be paused, call ScanSession.pauseScanning. Calling these two methods is preferred over calling BarcodePicker.stopScanning and BarcodePicker.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 ScanSession.getAllRecognizedCodes and ScanSession.getNewlyRecognizedCodes

Parameters
sessioncurrent scan session
See also
ScanSettings.setCodeDuplicateFilter
ScanSettings.setCodeCachingDuration

Implements OnScanListener.

◆ buildSuccessResult()

void buildSuccessResult ( Intent  resultIntent,
ScanSession  session 
)
protectedinherited

Builds the intent result in case of a successful scan.

You can override this method to customize the intent the activity returns. This function is not called on the main thread, UI operations can therefore not be performed.

Parameters
resultIntentThe intent which will be returned as the result.
sessionThe scan session of the successful scan.

◆ buildCancelResult()

void buildCancelResult ( Intent  resultIntent)
protectedinherited

Builds the intent result in case of the user canceling the activity.

You can override this method to customize the intent the activity returns.

Parameters
resultIntentThe intent which will be returned as the result.

The documentation for this class was generated from the following file:
  • BarcodePickerExternalActivity.java