Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions docs/partials/advanced/_validation-flow-cloud-vlm.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
### Cloud Fallback

:::warning Beta
The Adaptive Recognition API is still in beta and may change in future versions of Scandit Data Capture SDK. To enable it on your subscription, please contact [support@scandit.com](mailto:support@scandit.com).
:::

The Adaptive Recognition Engine helps making Smart Label Capture more robust and scalable thanks to its larger, more capable model hosted in the cloud. Whenever Smart Label Capture's on-device model fails to capture data, the SDK will automatically trigger the Adaptive Recognition Engine to capture complex, unforeseen data and process it with high accuracy and reliability — avoiding the need for the user to type data manually.

<p align="center">
<img src="/img/slc/validation-flow-cloud-vlm.gif" width="300px" alt="Cloud fallback using Adaptive Recognition" />
</p>

Enable Adaptive Recognition by setting the mode to `.auto` on the label definition. This is a single extra line added to your existing label definition configuration:
11 changes: 11 additions & 0 deletions docs/partials/advanced/_validation-flow-custom-buttons.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
### Customization

All text in the Validation Flow overlay can be adjusted to match your application's needs. This is useful for localization, adapting terminology, or removing text entirely for a minimal interface.

#### Buttons

The text on the restart, pause, and finish buttons can be customized or removed entirely.

| English (Default) | Custom Language | Company Slang | No Text |
|:---:|:---:|:---:|:---:|
| <img src="/img/slc/validation-flow-custom-buttons-english.PNG" width="200px" alt="Button text in English" /> | <img src="/img/slc/validation-flow-custom-buttons-spanish.PNG" width="200px" alt="Button text in Spanish" /> | <img src="/img/slc/validation-flow-custom-buttons-french.PNG" width="200px" alt="Button text in French" /> | <img src="/img/slc/validation-flow-custom-buttons-no-text.PNG" width="200px" alt="Buttons with no text" /> |
8 changes: 8 additions & 0 deletions docs/partials/advanced/_validation-flow-custom-field.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#### Field

The field state texts are shown inside the input field itself during different phases of scanning.

| Invalid Input | Scanning Text | Adaptive Scanning Text |
|:---:|:---:|:---:|
| Shown when manual input does not match the expected format | Shown while the camera is actively scanning | Shown while cloud-based recognition is processing |
| <img src="/img/slc/validation-flow-field-invalid-input.PNG" width="250px" alt="Invalid input state showing error styling" /> | <img src="/img/slc/validation-flow-field-scanning-text.gif" width="250px" alt="Scanning text shown while camera is active" /> | <img src="/img/slc/validation-flow-field-scanning-text.gif" width="250px" alt="Adaptive scanning text shown during cloud processing" /> |
7 changes: 7 additions & 0 deletions docs/partials/advanced/_validation-flow-custom-toasts.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#### Toasts

Toast messages appear at the top of the camera preview to inform the user about a scanning state change. The standby toast is shown when the camera is auto-paused after no label is detected for a long time. The validation toast shows how many fields have been captured so far after a scan.

| Standby | Validation |
|:---:|:---:|
| <img src="/img/slc/validation-flow-custom-toast-standby.PNG" width="250px" alt="Standby toast shown when no label is detected" /> | <img src="/img/slc/validation-flow-custom-toast-validation.PNG" width="250px" alt="Validation toast showing captured field count" /> |
12 changes: 12 additions & 0 deletions docs/partials/advanced/_validation-flow-how-it-works.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
### How It Works

The Validation Flow provides a guided label scanning experience. An always-present checklist shows users exactly which fields have been captured and which are still missing, making the scanning process transparent and efficient. Scanning is the fastest way to capture all label content — whether all fields are visible at once or spread across different sides of a package.

The fields shown in the checklist are driven by your Label Definition — the configuration that tells Label Capture which fields to recognize and extract. See the Label Definitions guide for details on how to set them up.

The Validation Flow overlay is a UI component built on top of Label Capture. To use it, create a `LabelCaptureValidationFlowOverlay` and add it to your data capture view.

| Single-Step Scan | Multi-Step Scan |
|:---:|:---:|
| All fields are visible together | Fields on different sides of the package |
| <img src="/img/slc/validation-flow-single-step.gif" width="250px" alt="Single-step scan capturing all fields at once" /> | <img src="/img/slc/validation-flow-multi-step.gif" width="250px" alt="Multi-step scan capturing fields from different sides" /> |
8 changes: 8 additions & 0 deletions docs/partials/advanced/_validation-flow-required-optional.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
### Required and Optional Fields

The Validation Flow clearly indicates which fields must be captured and which are optional. Required fields are visually highlighted and the flow can only be completed once all of them have been successfully scanned or manually entered. Optional fields are shown but do not block the user from finishing.

| Required Field | Optional Field |
|:---:|:---:|
| Must be captured to finish the flow | Does not block finishing |
| <img src="/img/slc/validation-flow-field-required.gif" width="250px" alt="Required fields must be captured to finish" /> | <img src="/img/slc/validation-flow-field-optional.gif" width="250px" alt="Optional fields do not block finishing" /> |
10 changes: 10 additions & 0 deletions docs/partials/advanced/_validation-flow-typing-hints.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
### Typing Hints

If neither on-device nor cloud-based scanning can capture a field, the user can always manually enter the value. To make manual input easier and reduce errors, you can configure placeholder text (typing hints) that show the expected format directly in the input field.

<p align="center">
<img src="/img/slc/validation-flow-typing-hints.gif" width="300px" alt="Typing hints showing expected input format" />
</p>


The field name in the label definition is used as the reference for setting placeholder text:
104 changes: 80 additions & 24 deletions docs/sdks/android/label-capture/advanced.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@ keywords:
- android
---

import ValidationFlowHowItWorks from '../../../partials/advanced/_validation-flow-how-it-works.mdx';
import ValidationFlowCustomButtons from '../../../partials/advanced/_validation-flow-custom-buttons.mdx';
import ValidationFlowTypingHints from '../../../partials/advanced/_validation-flow-typing-hints.mdx';
import ValidationFlowCloudVLM from '../../../partials/advanced/_validation-flow-cloud-vlm.mdx';
import ValidationFlowRequiredOptional from '../../../partials/advanced/_validation-flow-required-optional.mdx';
import ValidationFlowCustomToasts from '../../../partials/advanced/_validation-flow-custom-toasts.mdx';
import ValidationFlowCustomField from '../../../partials/advanced/_validation-flow-custom-field.mdx';

# Advanced Configurations

## Customization of the Overlays
Expand Down Expand Up @@ -143,11 +151,7 @@ advancedOverlay.listener = object : LabelCaptureAdvancedOverlayListener {

## Validation Flow

Implementing a validation flow in your Smart Label Capture application differs from the [Get Started](/sdks/android/label-capture/get-started.md) steps outlined earlier as follows:

### Visualize the Scan Process

Validation flow uses a different overlay, the [LabelCaptureValidationFlowOverlay](https://docs.scandit.com/data-capture-sdk/android/label-capture/api/ui/label-capture-validation-flow-overlay.html). This overlay provides a user interface that guides users through the label capture process, including validation steps.
<ValidationFlowHowItWorks/>

```kotlin
// Create the overlay
Expand All @@ -161,33 +165,85 @@ val validationFlowOverlay = LabelCaptureValidationFlowOverlay.newInstance(
validationFlowOverlay.listener = this
```

### Adjust the Hint Messages
### Define a Listener

When the user has verified that all fields are correctly captured and presses the finish button, the Validation Flow triggers a callback with the final results. To receive these results, implement the [LabelCaptureValidationFlowOverlayListener](https://docs.scandit.com/data-capture-sdk/android/label-capture/api/ui/label-capture-validation-flow-listener.html) interface:

```kotlin
// Configure the validation flow with custom settings
val validationSettings = LabelCaptureValidationFlowSettings.newInstance().apply {
missingFieldsHintText = "Please add this field"
standbyHintText = "No label detected, camera paused"
validationHintText = "fields captured" // X/Y (X fields out of total Y) is shown in front of this string
validationErrorText = "Input not valid"
requiredFieldErrorText = "This field is required"
manualInputButtonText = "Add info manually"
// This is called by the validation flow overlay when a label has been fully captured and validated
override fun onValidationFlowLabelCaptured(fields: List<LabelField>) {

val barcodeData = fields.find { it.name == "<your-barcode-field-name>" }?.barcode?.data

val expiryDate = fields.find { it.name == "<your-expiry-date-field-name>" }?.text
}
```

<ValidationFlowRequiredOptional/>

// Apply the settings to the overlay
validationFlowOverlay.applySettings(validationSettings)
<ValidationFlowTypingHints/>

```kotlin
val validationFlowOverlaySettings = LabelCaptureValidationFlowSettings.newInstance()
validationFlowOverlaySettings.setPlaceholderTextForLabelDefinition(FIELD_EXPIRY_DATE, "MM/DD/YYYY")
validationFlowOverlay.applySettings(validationFlowOverlaySettings)
```

### Define a Listener
<ValidationFlowCustomButtons/>

```kotlin
val validationFlowOverlaySettings = LabelCaptureValidationFlowSettings.newInstance()
validationFlowOverlaySettings.restartButtonText = "Borrar todo"
validationFlowOverlaySettings.pauseButtonText = "Pausar"
validationFlowOverlaySettings.finishButtonText = "Finalizar"

validationFlowOverlay.applySettings(validationFlowOverlaySettings)
```

To handle validation events, implement the [LabelCaptureValidationFlowOverlayListener](https://docs.scandit.com/data-capture-sdk/android/label-capture/api/ui/label-capture-validation-flow-listener.html) interface.
<ValidationFlowCustomToasts/>

```kotlin
// This is called by the validation flow overlay when a label has been fully captured and validated
override fun onValidationFlowLabelCaptured(fields: List<LabelField>) {

val barcodeData = fields.find { it.name == "<your-barcode-field-name>" }?.barcode?.data

val expiryDate = fields.find { it.name == "<your-expiry-date-field-name>" }?.text
val validationFlowOverlaySettings = LabelCaptureValidationFlowSettings.newInstance()
validationFlowOverlaySettings.standbyHintText = "No label detected, camera paused"
validationFlowOverlaySettings.validationHintText = "data fields collected" // X/Y (X fields out of total Y) is shown in front of this string

validationFlowOverlay.applySettings(validationFlowOverlaySettings)
```

<ValidationFlowCustomField/>

```kotlin
val validationFlowOverlaySettings = LabelCaptureValidationFlowSettings.newInstance()
validationFlowOverlaySettings.validationErrorText = "Incorrect format."
validationFlowOverlaySettings.scanningText = "Scan in progress"
validationFlowOverlaySettings.adaptiveScanningText = "Processing"

validationFlowOverlay.applySettings(validationFlowOverlaySettings)
```

<ValidationFlowCloudVLM/>

```kotlin
val settings = labelCaptureSettings {
label(LABEL_TITLE) {
customBarcode(FIELD_BARCODE) {
setSymbologies(
Symbology.EAN13_UPCA,
Symbology.GS1_DATABAR_EXPANDED,
Symbology.CODE128
)
}
expiryDateText(FIELD_EXPIRY_DATE) {
setLabelDateFormat(
LabelDateFormat(
componentFormat = LabelDateComponentFormat.MDY,
acceptPartialDates = false,
)
)
}
adaptiveRecognition(adaptiveRecognitionMode = AdaptiveRecognitionMode.AUTO)
}
}
```

See [AdaptiveRecognitionMode](https://docs.scandit.com/data-capture-sdk/android/label-capture/api/label-definition.html#property-scandit.datacapture.label.LabelDefinition.AdaptiveRecognitionMode) for available options.
101 changes: 100 additions & 1 deletion docs/sdks/capacitor/label-capture/advanced.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@ keywords:
- capacitor
---

import ValidationFlowHowItWorks from '../../../partials/advanced/_validation-flow-how-it-works.mdx';
import ValidationFlowCustomButtons from '../../../partials/advanced/_validation-flow-custom-buttons.mdx';
import ValidationFlowTypingHints from '../../../partials/advanced/_validation-flow-typing-hints.mdx';
import ValidationFlowCloudVLM from '../../../partials/advanced/_validation-flow-cloud-vlm.mdx';
import ValidationFlowRequiredOptional from '../../../partials/advanced/_validation-flow-required-optional.mdx';
import ValidationFlowCustomToasts from '../../../partials/advanced/_validation-flow-custom-toasts.mdx';
import ValidationFlowCustomField from '../../../partials/advanced/_validation-flow-custom-field.mdx';

# Advanced Configurations

## Customize the Overlay Appearance
Expand Down Expand Up @@ -68,4 +76,95 @@ Use brush colors with transparency (alpha < 100%) to not occlude the captured ba

## Validation Flow

Validation Flow is a workflow available in Smart Label Capture to improve the accuracy and completeness of scanned label data in real-world environments. See the [LabelCaptureValidationFlowOverlay](https://docs.scandit.com/data-capture-sdk/capacitor/label-capture/api/ui/label-capture-validation-flow-overlay.html) and [LabelCaptureValidationFlowSettings](https://docs.scandit.com/data-capture-sdk/capacitor/label-capture/api/ui/label-capture-validation-flow-settings.html) API references for implementation details.
<ValidationFlowHowItWorks/>

```js
// Create the overlay
const validationFlowOverlay = new LabelCaptureValidationFlowOverlay(labelCapture);
dataCaptureView.addOverlay(validationFlowOverlay);

// Set the listener to receive validation events
validationFlowOverlay.listener = validationFlowListener;
```

### Define a Listener

When the user has verified that all fields are correctly captured and presses the finish button, the Validation Flow triggers a callback with the final results. To receive these results, implement the [LabelCaptureValidationFlowListener](https://docs.scandit.com/data-capture-sdk/capacitor/label-capture/api/ui/label-capture-validation-flow-listener.html) interface:

```js
const validationFlowListener = {
// This is called by the validation flow overlay when a label has been fully captured and validated
didCaptureLabelWithFields: (fields) => {
const barcodeData = fields.find(f => f.name === "<your-barcode-field-name>")?.barcode?.data;
const expiryDate = fields.find(f => f.name === "<your-expiry-date-field-name>")?.text;

// Handle the captured values
}
};
```

<ValidationFlowRequiredOptional/>

<ValidationFlowTypingHints/>

```js
const validationFlowOverlaySettings = LabelCaptureValidationFlowSettings.create();
validationFlowOverlaySettings.setPlaceholderTextForLabelDefinition("Expiry Date", "MM/DD/YYYY");

validationFlowOverlay.applySettings(validationFlowOverlaySettings);
```

<ValidationFlowCustomButtons/>

```js
const validationFlowOverlaySettings = LabelCaptureValidationFlowSettings.create();
validationFlowOverlaySettings.restartButtonText = "Borrar todo";
validationFlowOverlaySettings.pauseButtonText = "Pausar";
validationFlowOverlaySettings.finishButtonText = "Finalizar";

validationFlowOverlay.applySettings(validationFlowOverlaySettings);
```

<ValidationFlowCustomToasts/>

```js
const validationFlowOverlaySettings = LabelCaptureValidationFlowSettings.create();
validationFlowOverlaySettings.standbyHintText = "No label detected, camera paused";
validationFlowOverlaySettings.validationHintText = "data fields collected"; // X/Y (X fields out of total Y) is shown in front of this string

validationFlowOverlay.applySettings(validationFlowOverlaySettings);
```

<ValidationFlowCustomField/>

```js
const validationFlowOverlaySettings = LabelCaptureValidationFlowSettings.create();
validationFlowOverlaySettings.validationErrorText = "Incorrect format.";
validationFlowOverlaySettings.scanningText = "Scan in progress";
validationFlowOverlaySettings.adaptiveScanningText = "Processing";

validationFlowOverlay.applySettings(validationFlowOverlaySettings);
```

<ValidationFlowCloudVLM/>

```js
const customBarcode = CustomBarcode.initWithNameAndSymbologies('Barcode', [
Symbology.EAN13UPCA,
Symbology.GS1DatabarExpanded,
Symbology.Code128,
]);
customBarcode.optional = false;

const expiryDateText = new ExpiryDateText('Expiry Date');
expiryDateText.labelDateFormat = new LabelDateFormat(LabelDateComponentFormat.MDY, false);
expiryDateText.optional = false;

const label = new LabelDefinition('Retail Item');
label.fields = [customBarcode, expiryDateText];
label.adaptiveRecognitionMode = AdaptiveRecognitionMode.Auto;

const settings = LabelCaptureSettings.settingsFromLabelDefinitions([label], {});
```

See [AdaptiveRecognitionMode](https://docs.scandit.com/data-capture-sdk/capacitor/label-capture/api/label-definition.html#property-scandit.datacapture.label.LabelDefinition.AdaptiveRecognitionMode) for available options.
Loading
Loading