Barcode Capture Settings

Defined in package com.scandit.datacapture.barcode.capture

class BarcodeCaptureSettings

Added in version 6.0.0

Holds all the barcode recognition related settings, such as enabled symbologies and location selection. For the settings to take effect, they must be applied to a barcode capture instance using BarcodeCapture.applySettings().

By default, all types of barcodes (symbologies) are disabled. To scan barcodes, you need to manually enable all the symbologies you want to scan in your application.

The following lines of code show how to enable Symbology.CODE128 and apply the settings to barcode capture.

BarcodeCaptureSettings settings = new BarcodeCaptureSettings();
settings.enableSymbology(Symbology.CODE128, true);
barcodeCapture.applySettings(settings, null);

Added in version 6.0.0

Creates new default settings instance. Recognition is setup for recognizing codes in the full image. Symbologies are all disabled. Before passing the settings to the BarcodeCapture instance, make sure to enable the symbologies required by your application.

BarcodeCaptureSettings(@NonNull Set<CapturePreset> capturePresets)

Added in version 6.19.0

Constructs new barcode capture settings based on the provided presets, enabling relevant symbologies and optimizations. See CapturePreset for more information on how to use capture presets.

static @NonNull BarcodeCaptureSettings fromJson(@NonNull String jsonData)

Added in version 6.0.0

Constructs new barcode capture settings with the provided JSON serialization. See Serialization for details.

@NonNull SymbologySettings getSymbologySettings(Symbology symbology)

Added in version 6.0.0

Get SymbologySettings specific for the given Symbology.

Note that modifying the returned object doesn’t automatically apply the changes to BarcodeCapture. After you made changes to the symbology settings, call BarcodeCapture.applySettings() with these BarcodeCaptureSettings to apply them.

setProperty(name, value)
void setProperty(@NonNull String name,
        @NonNull Object value)

Added in version 6.0.0

Sets a property to the provided value. Use this method to set properties that are not yet part of a stable API. Properties set through this method may or may not be used or change in a future release.

@NonNull Object getProperty(@NonNull String key)

Added in version 6.0.0

Retrieves the value of a previously set property. In case the property does not exist, -1 is returned.

@NonNull TimeInterval getCodeDuplicateFilter()
void setCodeDuplicateFilter(@NonNull TimeInterval value)

Added in version 6.0.0

Determines the time interval in which codes with the same symbology/data are filtered out as duplicates. By default, when the same code (data, symbology) is scanned in consecutive frames, it is reported again as a new scan. Use this property to change the interval or completely turn off duplicate filtering:

  • Setting this property to value smaller than zero, means that the same code will not be reported again until the scanning has been stopped.

  • Setting this property to a value of zero means that the same code will be reported every time it is found.

  • Setting this property to a value larger than zero indicates the time that must pass between the same code to be reported again.

The filtering is reset any time the capture mode is disabled (DataCaptureMode.isEnabled is set to false) as this is when the session is cleaned and restarts from zero.

@NonNull Set<Symbology> getEnabledSymbologies()

Added in version 6.0.0

Returns the set of enabled symbologies.

enableSymbology(symbology, enabled)
void enableSymbology(Symbology symbology,
        boolean enabled)

Added in version 6.0.0

Provides a convenient shortcut to enable/disable decoding of a particular symbology without having to go through SymbologySettings.

Some 1d barcode symbologies allow you to encode variable-length data. By default, the Scandit Data Capture SDK only scans barcodes in a certain length range.

If your application requires scanning of one of these symbologies, and the length is falling outside the default range, you may need to adjust the active symbol counts for the symbology in addition to enabling it.

void enableSymbologies(@NonNull Set<Symbology> symbologies)

Added in version 6.0.0

Provides a convenient shortcut to enable decoding of particular symbologies without having to go through SymbologySettings. By default, all symbologies are turned off and symbologies need to be explicitly enabled.

void enableSymbologies(@NonNull EnumSet<CompositeType> compositeTypes)

Added in version 6.6.0

Enables all symbologies needed for the given composite types. To enable composite codes scanning it is also needed to enable the composite types through enabledCompositeTypes. By default, all symbologies are turned off and symbologies need to be explicitly enabled.

@NonNull EnumSet<CompositeType> getEnabledCompositeTypes()
void setEnabledCompositeTypes(@NonNull EnumSet<CompositeType> value)

Added in version 6.6.0

The enabled composite types. To enable composite codes scanning it is also needed to enable the symbologies that make up the specific type of composite code through enableSymbologies().

@Nullable LocationSelection getLocationSelection()
void setLocationSelection(@Nullable LocationSelection value)

Added in version 6.0.0

Defines the strategy with which to select one out of many visible barcodes. See Location Selection Guide. By default, this property is null and code selection is disabled.

void updateFromJson(@NonNull String jsonData)

Added in version 6.0.0

Updates the settings according to a JSON serialization. See Serialization for details.

void setArucoDictionary(@NonNull ArucoDictionary dictionary)

Added in version 6.19.0

Sets the ArucoDictionary to be used while scanning ArUco codes. When the symbology is enabled the dictionary ArucoDictionaryPreset.ARUCO_DICTIONARY_PRESET_5X5_1000 is loaded as default.

BatterySavingMode getBatterySavingMode()
void setBatterySavingMode(BatterySavingMode value)

Added in version 6.22.0

The battery saving mode to use with BarcodeCapture. Default to BatterySavingMode.OFF, ensuring the standard performance. Set to BatterySavingMode.AUTO to automatically enable the battery saving mode when a higher than usual consumption of the battery is detected, balancing performance and battery lifetime.

ScanIntention getScanIntention()
void setScanIntention(ScanIntention value)

Added in version 6.24.0

The scan intention algorithm to use with BarcodeCapture. Defaults to ScanIntention.MANUAL, ensuring the standard performance with no smart algorithms. Set to ScanIntention.SMART to enable the automatic algorithm that intelligently identifies and then scans the barcode that the user intends to capture, reducing errors.