Skip to main content
Not sure which Scandit product fits your use case?

Install our data-capture-sdk skill so your coding agent can answer questions about Scandit products and recommend the right one for your use case, directly from your editor. More info →

Run this in a terminal in your project directory, then follow the instructions to select your coding agent.

npx skills add https://github.com/scandit/skills --skill data-capture-sdk

Your coding agent loads the skill automatically based on your prompt; to invoke it explicitly, call /data-capture-sdk followed by your task.

Advanced Configurations

MatrixScan Pick is optimized by default for efficiency, accuracy, and a seamless user experience. However, there are multiple advanced settings available to further customize MatrixScan Pick to best fit your needs.

BarcodePick Listener

You can register a BarcodePickListener on the mode, which can be used to get updates about the scanned items with each frame.

barcodePick.addListener(object : BarcodePickListener {
override fun onSessionUpdated(barcodePick: BarcodePick, session: BarcodePickSession) {
// This callback will be invoked on a background thread every frame. the session object contains
// updated the newly tracked items.
}

override fun onObservationStarted(barcodePick: BarcodePick) {}

override fun onObservationStopped(barcodePick: BarcodePick) {}
})

BarcodePickScanning Listener

You can register a BarcodePickScanningListener on the mode, which can be used to listen to every time the pick state changes.

barcodePick.addScanningListener(object : BarcodePickScanningListener {
override fun onScanningSessionUpdated(barcodePick: BarcodePick, session: BarcodePickScanningSession) {
// This callback will be invoked on a background thread every time the picked state of some item changes.
// The session object contains the list of picked and scanned items.
}

override fun onScanningSessionCompleted(barcodePick: BarcodePick, session: BarcodePickScanningSession) {
// This callback is invoked when all the registered items needing picking have been picked.
}

override fun onObservationStarted(barcodePick: BarcodePick) {}

override fun onObservationStopped(barcodePick: BarcodePick) {}
})

BarcodePickView Listener

You may want more fine-grained knowledge over the different events happening during the life of the BarcodePick mode, such as when the search starts, pauses, and stops.

To do this, you can directly register a BarcodePickViewListener on the mode itself, keeping in mind that these listeners are called from a background thread.

barcodePickView.listener = object : BarcodePickViewListener {
override fun onStopped(view: BarcodePickView) {}

override fun onPaused(view: BarcodePickView) {}

override fun onFreezed(view: BarcodePickView) {}

override fun onStarted(view: BarcodePickView) {}
}

BarcodePickAction Listener

You can also register a BarcodePickActionListener on the mode, which can be used to reject specific pick/unpick actions.

barcodePickView.addActionListener(object : BarcodePickActionListener {
override fun onPick(itemData: String, callback: BarcodePickActionCallback) {
// Perform the needed checks, and invoke callback.onFinish(true/false) to allow/reject
// the current pick action
}

override fun onUnpick(itemData: String, callback: BarcodePickActionCallback) {
// Perform the needed checks, and invoke callback.onFinish(true/false) to allow/reject
// the current unpick action
}
})