Skip to main content
Speed up SparkScan integration with Agent Skills

Install the Scandit plugin and use the /sparkscan-android skill so that your AI coding agent can integrate, debug, and customize SparkScan on Android following Scandit's recommended patterns. More info →

Run the following command in your project directory. It detects the supported coding agents you have installed and adds the Scandit plugin to each. Re-run it to update.

npx plugins add scandit/skills

Prefer to set it up yourself? Manual installation steps for each agent →

SparkScan settings reference

This page lists the SparkScan settings and view properties on Android, with their defaults and allowed values as the API reference states them. A blank default means the API reference states none. For what the workflow settings do for your users, see How SparkScan works.

Options​

SparkScanSettings​

SparkScanSettings configures the capture mode: which barcodes it scans and how. After you change settings, apply them with SparkScan.applySettings().

NameTypeDefaultValuesWhat it does
selectionModeSelectionModeAUTOAUTO, OFF, ONSets whether users confirm the aimed barcode before it's scanned. Added in 8.5.0.
scanIntentionScanIntentionSMARTSMART, MANUALSets the scan intention algorithm. SMART_SELECTION is deprecated; use selectionMode set to AUTO instead.
codeDuplicateFilterTimeIntervalCodeDuplicate.defaultDuplicateFilterCodeDuplicate.defaultDuplicateFilter, CodeDuplicate.reportDataAndSymbologyOnlyOnce, 0, or a positive intervalSets how long a code with the same symbology and data is filtered out as a duplicate. The default depends on scanIntention: smart duplicate filtering with SMART, 1.5 seconds with MANUAL. 0 reports the code every time. If you keep the default and turn the selection mode On, SparkScan doesn't filter duplicates, so users can select the same barcode again.
batterySavingBatterySavingModeAUTOAUTO, ON, OFFSets the battery saving mode. AUTO turns it on when battery use is higher than usual.
enabledSymbologiesSet<Symbology>EmptyRead-only. The enabled symbologies. All symbologies are off by default.
enabledCompositeTypesEnumSet<CompositeType>Sets the composite code types to scan. Also enable their symbologies. Added in 8.3.0.
scanItemDefinitionsList<ScanItemDefinition>?Configures the settings with the item-based scanning API. When set, enabledSymbologies is ignored. Beta.

To enable symbologies, use enableSymbologies() or enableSymbology(). For per-symbology options, use getSymbologySettings().

SparkScanViewSettings​

SparkScanViewSettings configures the SparkScan view. Set them before you create the SparkScanView. Changes after that don't apply to the view.

NameTypeDefaultValuesWhat it does
scanningBehaviorSparkScanScanningBehaviorSINGLESINGLE, CONTINUOUSSets whether users scan one barcode per trigger or scan continuously. Added in 8.5.0.
previewBehaviorSparkScanPreviewBehaviorDEFAULTDEFAULT, PERSISTENTSets whether the preview hides after a scan or stays visible. Added in 8.5.0.
holdToScanEnabledBooleantrueKeeps scanning while users hold the trigger button. Ignored when selectionMode is ON.
hardwareTriggerEnabledBooleanfalseLets users start scanning with the hardware button set in hardwareTriggerKeyCode. Needs API level 28 or higher.
hardwareTriggerKeyCodeInt?A key codeSets the hardware button. null uses the dedicated button on XCover devices and KeyEvent.KEYCODE_VOLUME_DOWN on other devices.
triggerButtonCollapseTimeoutTimeInterval5 secondsA negative value means no timeoutSets the time after which the view returns to the idle state.
inactiveStateTimeoutTimeInterval10 secondsSets the time after which capturing stops.
soundEnabledBooleantruePlays a sound as scan feedback.
hapticEnabledBooleantrueVibrates as scan feedback.
visualFeedbackEnabledBooleantrueShows visual feedback on each scan.
defaultTorchStateTorchStateOFFOFF, ON, AUTOSets the torch state when scanning starts.
defaultCameraPositionCameraPositionWORLD_FACINGWORLD_FACING, USER_FACING, UNSPECIFIEDSets the camera that scanning starts with. Beta.
defaultMiniPreviewSizeSparkScanMiniPreviewSizeREGULARREGULAR, EXPANDEDSets the size of the mini preview.
zoomFactorOutFloat1Sets the camera zoom factor.
zoomFactorInFloat2Sets the zoom factor after users tap the zoom switch control.
toastSettingsSparkScanToastSettingsSets the toast messages and their colors.
selectionModeCandidateBrushBrush?Sets the brush for candidate barcodes when selectionMode is AUTO. null uses the default brush. Added in 8.5.0.

SparkScanView properties​

You set these properties on the SparkScanView after you create it.

NameTypeDefaultValuesWhat it does
feedbackDelegateSparkScanFeedbackDelegate?Sets the delegate that returns success or error feedback for each barcode. By default, every scan gets success feedback. If you set it to null, or your delegate returns null, scans get no feedback.
hardwareTriggerSupportedBooleanRead-only. Whether the device supports hardware buttons.
triggerButtonVisibleBooleantrueShows the trigger button.
torchControlVisibleBooleantrueShows the torch control. It's hidden when defaultTorchState is AUTO.
zoomSwitchControlVisibleBooleantrueShows the zoom switch control.
previewSizeControlVisibleBooleantrueShows the mini preview size control.
previewCloseControlVisibleBooleantrueShows the mini preview close control.
scanningBehaviorButtonVisibleBooleanfalseShows the scanning behavior button in the toolbar.
selectionModeButtonVisibleBooleanfalseShows the selection mode button, which switches selectionMode between ON and OFF. Added in 8.5.0.
cameraSwitchButtonVisibleBooleanfalseShows the camera switch button. Beta.
barcodeCountButtonVisibleBooleanfalseShows the MatrixScan Count button in the toolbar.
barcodeFindButtonVisibleBooleanfalseShows the MatrixScan Find button in the toolbar.
labelCaptureButtonVisibleBooleanfalseShows the Smart Label Capture button in the toolbar.
triggerButtonImageBitmap?Sets the image on the trigger button. To use a resource, call setTriggerButtonImage().
triggerButtonCollapsedColorInt?Sets the background color of the collapsed trigger button.
triggerButtonExpandedColorInt?Sets the background color of the expanded trigger button.
triggerButtonAnimationColorInt?Sets the color of the pulsing animation around the trigger button while the scanner is active.
triggerButtonTintColorInt?Sets the tint color of the trigger button.
toolbarBackgroundColorInt?nullSets the background color of the toolbar.
toolbarIconActiveTintColorInt?nullSets the color of active toolbar icons.
toolbarIconInactiveTintColorInt?nullSets the color of inactive toolbar icons.

To get toolbar button taps and view state changes, set a UI listener with setListener().

Framework differences​

On Android, these options differ from the other SparkScan frameworks:

  • You pick the hardware trigger button by its key code.
  • Android has no periscope mode. It's available on iOS only.

Next step​

Choosing which barcode types to scan