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 →

How SparkScan works

SparkScan adds two elements on top of your app, a trigger button and a mini preview, and runs a fixed scanning workflow by default. You change that workflow with three settings, selection mode, scanning behavior and preview behavior, and you can stop the workflow with an error state when your app rejects a barcode.

Why it matters​

The defaults fit most scan-intensive apps, so you can ship SparkScan without changing anything. When your users' workflow is different, for example they scan dozens of items in a row or must pick one barcode from a dense shelf label, you choose settings that match it. Knowing what each setting does to the UI lets you pick the right ones instead of trying combinations on a device.

How it works​

The UI elements​

The SparkScan mini preview and trigger button

  • Trigger button: a large, semi-transparent floating button that users tap to start scanning. Users can drag it to the position that's most comfortable for them. It collapses when it isn't in use, so it takes up less space.
  • Mini preview: a small camera preview that helps users aim and shows feedback after each scan. It has controls, such as zoom and flash, and users can expand it. SparkScan hides it when it isn't in use.
  • Settings toolbar: a toolbar at the bottom of the mini preview. It's hidden by default and appears when you show one of its buttons, such as buttons that switch to other scanning modes.

SparkScan uses the color and the sound or vibration of its feedback to tell users whether a scan was accepted.

Default workflow​

When SparkScan starts, it shows only the collapsed trigger button. Users can drag the button to move it. SparkScan remembers the button's position across sessions.

To start scanning, users tap the trigger button.

While the scanner is active, SparkScan shows the mini preview. To move the mini preview, users touch & hold it, and then drag it. SparkScan also remembers its position across sessions, so users can keep it from covering important information, for example at the top of the app.

By default:

  • After each scan, users get a sound or a vibration that confirms the scan. The mini preview shows the scanned barcode for a moment, and then fades.
  • To scan again, users tap the trigger button. When the scanner is stopped and the mini preview is still visible, for example with the persistent preview behavior, users can also tap the mini preview.

To stop scanning, users tap anywhere outside the trigger button and the mini preview. The trigger button collapses, and the mini preview hides. That tap only stops scanning: to use the app underneath, users tap again.

To scan several barcodes in a row, users touch & hold the trigger button. Scanning stops when they release it.

A user builds a list of items by scanning with SparkScan
Building a list with SparkScan.

What you can change​

The default workflow fits most apps. When yours is different, three settings set the scanner's initial state. You can combine them.

Selection mode​

The selection mode decides whether the mini preview shows an aimer, so users can choose one barcode when several are in view.

ModeWhat users see
Auto (default)When several barcodes are in view, an aimer appears and the mini preview expands. Users aim at the barcode they want and confirm it with the trigger button. With one barcode in view, SparkScan scans it without a confirmation.
OffNo aimer. Users aim with the mini preview, which they can resize and zoom.
OnAlways an aimer. Users aim at a barcode and confirm it with the trigger button. Use it only when choosing among many close barcodes is the common task.

Scanning behavior​

The scanning behavior decides whether users scan one barcode per trigger or many.

BehaviorWhat users do
Single (default)Users trigger the scanner for each barcode. After each scan, the camera goes to standby until the next trigger.
ContinuousUsers trigger the scanner once, and SparkScan scans barcodes one after another until they stop it. By default, scanning also stops after 10 seconds without a scan. Use it when users scan many barcodes in a row.

Users can also scan continuously by touching & holding the trigger button, unless you turn that gesture off or set the selection mode to On.

Preview behavior​

The preview behavior decides what the mini preview does when the scanner isn't scanning.

BehaviorWhat users see
DefaultThe preview fades when the scanner stops, so users can read the app underneath, and the camera goes to standby.
PersistentThe preview stays visible when the scanner stops, darkened and with a message that scanning is paused, until the trigger button collapses. The camera keeps running. Use it when users need to see through the preview all the time, for example to choose a barcode with selection mode On.

Error state​

Your app can reject a scanned barcode, for example one that's already on a list or that comes from the wrong lot. SparkScan then shows an error state instead of the success feedback: a message, a color, and an error sound or vibration. While the error shows, the scanner pauses for a timeout you set, and users can tap the trigger button to scan again sooner.

  • A long timeout keeps the scanner paused while users deal with the error, until they tap the trigger button. Use it when a wrong barcode needs the user to do something.
  • A short timeout pauses scanning only briefly, so users notice the error and keep scanning.
  • A timeout of 0 rejects the barcode without pausing and without a message. Users get only the error color, the highlight on the barcode, and the error sound or vibration.

You can show different error states for different conditions, each with its own message, color, and timeout.

An error state for a wrong barcode
An error state for a barcode that shouldn't have been scanned.
An error state for a duplicate barcode
An error state for a barcode that was already scanned.

Key terms​

Each term links to its full definition in the glossary.

  • Trigger button: The large floating SparkScan button that the user taps to start scanning and can drag to any position.
  • Mini preview: The small SparkScan camera preview that helps users aim and shows scan feedback.
  • Scan intention: The setting that lets the SDK anticipate which barcode the user means to scan and ignore the rest.
  • Error state: The SparkScan state that shows an error, and can pause scanning, when your app rejects a scanned barcode.

When it applies​

Next step​

Getting started with SparkScan