SparkScan Settings
Defined in package com.scandit.datacapture.barcode.spark
- SparkScanSettings
class SparkScanSettingsAdded in version 8.6.0
Holds all the SparkScan settings, such as enabled symbologies and scan intention.
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 SparkScan.
- sparkScanSettings()
fun SparkScanSettings.sparkScanSettings(): SparkScanSettings
Added in version 8.6.0
Creates new default settings instance. Symbologies are all disabled. Before passing the settings to the SparkScan instance, make sure to enable the symbologies required by your application.
- sparkScanSettings(capturePresets)
fun SparkScanSettings.sparkScanSettings(capturePresets: Set<CapturePreset>): SparkScanSettings
Added in version 8.6.0
Constructs new Spark Scan settings based on the provided presets, enabling relevant symbologies and optimizations. See CapturePreset for more information on how to use capture presets.
- getSymbologySettings(symbology)
fun getSymbologySettings(symbology: Symbology): SymbologySettings
Added in version 8.6.0
Gets SymbologySettings specific for the given Symbology.
- setProperty(name, value)
fun setProperty(name: String, value: Any)
Added in version 8.6.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.
- getProperty(name)
fun getProperty(name: String): Any?
Added in version 8.6.0
Retrieves the value of a previously set property.
- codeDuplicateFilter
var codeDuplicateFilter: Long
Added in version 8.6.0
Determines the time interval in which codes with the same symbology/data are filtered out as duplicates. Use this property to change the interval or completely turn off duplicate filtering:
Setting this property to the special value -2 (default from SDK version 7.1.0) will result in a behavior that depends on scanIntention. - If ScanIntention.SMART (default from 8.1), it enables the Smart Duplicate Filter algorithm that intelligently reports a duplicate when the user intends to scan it again, reducing errors and speeding up the workflow. - If ScanIntention.MANUAL, it acts as when setting codeDuplicateFilter to 1.5s (check the following). This behavior applies also to the cases in which the Android device doesn’t support ScanIntention.SMART.
Setting this property to the special value -1 means that the same code will not be reported again until the scanning has been stopped.
Setting this property to a value of 0 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.
- enabledSymbologies
val enabledSymbologies: Set<Symbology>
Added in version 8.6.0
Returns the set of enabled symbologies.
- enableSymbology(symbology, enabled)
fun enableSymbology(symbology: Symbology, enabled:
Boolean)Added in version 8.6.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.
- enableSymbologies(symbologies)
fun enableSymbologies(symbologies: Set<Symbology>)
Added in version 8.6.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.
- enableSymbologiesForCompositeTypes(compositeTypes)
fun enableSymbologiesForCompositeTypes(compositeTypes: Set<CompositeType>)
Added in version 8.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.
- enabledCompositeTypes
var enabledCompositeTypes: Set<CompositeType>
Added in version 8.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 enableSymbologiesForCompositeTypes().
- batterySaving
var batterySaving: BatterySavingMode
Added in version 8.6.0
The battery saving mode to use with SparkScan. Default to BatterySavingMode.AUTO, automatically enabling the battery saving mode when a higher than usual consumption of the battery is detected, balancing performance and battery lifetime.
- scanIntention
var scanIntention: ScanIntention
Added in version 8.6.0
- selectionMode
var selectionMode: SelectionMode
Added in version 8.6.0
Controls whether the aimed-at barcode is scanned without user confirmation. Defaults to SelectionMode.AUTO, letting the SDK decide dynamically.
Set to SelectionMode.OFF to scan barcodes automatically as soon as they are aimed at. Set to SelectionMode.ON to always require an explicit tap on the SparkScan trigger button to confirm the scan.
Note
SelectionMode.AUTO requires scanIntention to be set to ScanIntention.SMART; with ScanIntention.MANUAL it behaves like SelectionMode.OFF. Automatic selection only activates on devices that support Smart.