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
12 changes: 6 additions & 6 deletions docs/sdks/net/android/barcode-capture/get-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ Symbology.Ean13Upca
settings.EnableSymbologies(symbologies);
```

If you are not disabling barcode capture immediately after having scanned the first code, consider setting the [BarcodeCaptureSettings.CodeDuplicateFilter](https://docs.scandit.com/data-capture-sdk/dotnet.android/barcode-capture/api/barcode-capture-settings.html#property-scandit.datacapture.barcode.BarcodeCaptureSettings.CodeDuplicateFilter) to around 500 or even \-1 if you do not want codes to be scanned more than once.
If you are not disabling barcode capture immediately after having scanned the first code, consider setting the [BarcodeCaptureSettings.CodeDuplicateFilter](https://docs.scandit.com/data-capture-sdk/dotnet.android/barcode-capture/api/barcode-capture-settings.html#property-scandit.datacapture.barcode.BarcodeCaptureSettings.CodeDuplicateFilter) to `TimeSpan.FromMilliseconds(500)` or even `CodeDuplicate.ReportDataAndSymbologyOnlyOnce` (equivalent to `TimeSpan.FromSeconds(-1)`) if you do not want codes to be scanned more than once.

Next, create a [BarcodeCapture](https://docs.scandit.com/data-capture-sdk/dotnet.android/barcode-capture/api/barcode-capture.html#class-scandit.datacapture.barcode.BarcodeCapture) instance with the settings initialized in the previous step:

Expand All @@ -66,8 +66,8 @@ First implement the [IBarcodeCaptureListener](https://docs.scandit.com/data-capt
```csharp
public void OnBarcodeScanned(BarcodeCapture barcodeCapture, BarcodeCaptureSession session, IFrameData frameData)
{
IList<Barcode> barcodes = session?.NewlyRecognizedBarcode;
// Do something with the barcodes
Barcode? barcode = session.NewlyRecognizedBarcode;
// Do something with the barcode
}
```

Expand All @@ -82,8 +82,8 @@ Alternatively to register [IBarcodeCaptureListener](https://docs.scandit.com/dat
```csharp
barcodeCapture.BarcodeScanned += (object sender, BarcodeCaptureEventArgs args) =>
{
IList<Barcode> barcodes = args.Session?.NewlyRecognizedBarcode;
// Do something with the barcodes
Barcode? barcode = args.Session.NewlyRecognizedBarcode;
// Do something with the barcode
}
```

Expand Down Expand Up @@ -137,7 +137,7 @@ camera?.SwitchToDesiredStateAsync(FrameSourceState.On);
When using the built-in camera as frame source, you will typically want to display the camera preview on the screen together with UI elements that guide the user through the capturing process. To do that, add a [DataCaptureView](https://docs.scandit.com/data-capture-sdk/dotnet.android/core/api/ui/data-capture-view.html#class-scandit.datacapture.core.ui.DataCaptureView) to your view hierarchy:

```csharp
DataCaptureView dataCaptureView = DataCaptureView.Create(this, dataCaptureContext);
DataCaptureView dataCaptureView = DataCaptureView.Create(dataCaptureContext);
SetContentView(dataCaptureView);
```

Expand Down
6 changes: 3 additions & 3 deletions docs/sdks/net/android/barcode-selection/get-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ To get informed whenever a new code has been recognized, add a [IBarcodeSelectio
First implement the [IBarcodeSelectionListener](https://docs.scandit.com/data-capture-sdk/dotnet.android/barcode-capture/api/barcode-selection-listener.html#interface-scandit.datacapture.barcode.selection.IBarcodeSelectionListener) interface. For example:

```csharp
public class MyBarcodeSelectionListener : Java.Lang.Object, IBarcodeSelectionListener
public class MyBarcodeSelectionListener : IBarcodeSelectionListener
{
public void OnObservationStarted(BarcodeSelection barcodeSelection)
{
Expand All @@ -100,7 +100,7 @@ public void OnObservationStopped(BarcodeSelection barcodeSelection)
public void OnSessionUpdated(
BarcodeSelection barcodeSelection,
BarcodeSelectionSession session,
IFrameData frameData)
IFrameData? frameData)
{
// Called every new frame.
// We don't use this callback in this guide.
Expand All @@ -109,7 +109,7 @@ IFrameData frameData)
public void OnSelectionUpdated(
BarcodeSelection barcodeSelection,
BarcodeSelectionSession session,
IFrameData frameData)
IFrameData? frameData)
{
IList<Barcode> newlySelectedBarcodes = session.NewlySelectedBarcodes;
IList<Barcode> selectedBarcodes = session.SelectedBarcodes;
Expand Down
29 changes: 14 additions & 15 deletions docs/sdks/net/android/id-capture/advanced.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,53 +18,52 @@ That means certain data from certain fields won’t be returned, even if it’s

```csharp
// Default value:
settings.setAnyonymizationMode(IdAnonymizationMode.FIELDS_ONLY);
settings.AnonymizationMode = IdAnonymizationMode.FieldsOnly;

// Sensitive data is additionally covered with black boxes on returned images:
settings.setAnyonymizationMode(IdAnonymizationMode.FIELDS_AND_IMAGES);
settings.AnonymizationMode = IdAnonymizationMode.FieldsAndImages;

// Only images are anonymized:
settings.setAnyonymizationMode(IdAnonymizationMode.IMAGES_ONLY);
settings.AnonymizationMode = IdAnonymizationMode.ImagesOnly;

// No anonymization:
settings.setAnyonymizationMode(IdAnonymizationMode.NONE);
settings.AnonymizationMode = IdAnonymizationMode.None;
```

## Document Capture Zones

By default, a new instance of [IdCaptureSettings](https://docs.scandit.com/data-capture-sdk/dotnet.android/id-capture/api/id-capture-settings.html#class-scandit.datacapture.id.IdCaptureSettings) creates a single-sided scanner type with no accepted or rejected documents.

To change this, use the `scannerType` method to set the scanner type to either [SingleSideScanner](https://docs.scandit.com/data-capture-sdk/dotnet.android/id-capture/api/id-capture-scanner.html#single-side-scanner) or [FullDocumentScanner](https://docs.scandit.com/data-capture-sdk/dotnet.android/id-capture/api/id-capture-scanner.html#full-document-scanner).
To change this, set the `Scanner` property on `IdCaptureSettings` to an [IdCaptureScanner](https://docs.scandit.com/data-capture-sdk/dotnet.android/id-capture/api/id-capture-scanner.html) configured with either a [SingleSideScanner](https://docs.scandit.com/data-capture-sdk/dotnet.android/id-capture/api/id-capture-scanner.html#single-side-scanner) or [FullDocumentScanner](https://docs.scandit.com/data-capture-sdk/dotnet.android/id-capture/api/id-capture-scanner.html#full-document-scanner).


The `FullDocumentScanner` extracts all document information by default. If using the `SingleSideScanner`, you can specify the document zones to extract:
The `FullDocumentScanner` extracts all document information by default. If using the `SingleSideScanner`, you can specify the document zones to extract via its constructor parameters:

```csharp
// To extract data from barcodes on IDs
SingleSideScanner.barcode(true);
settings.Scanner = new IdCaptureScanner(new SingleSideScanner(barcode: true, machineReadableZone: false, visualInspectionZone: false), mobileDocument: null);
// To extract data from the visual inspection zone (VIZ) on IDs
SingleSideScanner.visualInspectionZone(true);
settings.Scanner = new IdCaptureScanner(new SingleSideScanner(barcode: false, machineReadableZone: false, visualInspectionZone: true), mobileDocument: null);
// To extract data from the machine-readable zone (MRZ) on IDs
SingleSideScanner.machineReadableZone(true);
settings.Scanner = new IdCaptureScanner(new SingleSideScanner(barcode: false, machineReadableZone: true, visualInspectionZone: false), mobileDocument: null);
```

## Configure Accepted and Rejected Documents

To configure the documents that should be accepted and/or rejected, use the `acceptedDocuments` and `rejectedDocuments` methods in `IdCaptureSettings`.
To configure the documents that should be accepted and/or rejected, set the `AcceptedDocuments` and `RejectedDocuments` properties in `IdCaptureSettings`.

These methods are used in conjunction with the [IdCaptureDocumentType](https://docs.scandit.com/data-capture-sdk/dotnet.android/id-capture/api/id-capture-document.html#enum-scandit.datacapture.id.IdCaptureDocumentType) and [IdCaptureRegion](https://docs.scandit.com/data-capture-sdk/dotnet.android/id-capture/api/id-capture-region.html#enum-scandit.datacapture.id.IdCaptureRegion) enums to enable highly flexible document filtering as may be desired in your application.
These properties take a list of [IIdCaptureDocument](https://docs.scandit.com/data-capture-sdk/dotnet.android/id-capture/api/id-capture-document.html) instances (e.g. `Passport`, `DriverLicense`, `IdCard`) combined with the [IdCaptureRegion](https://docs.scandit.com/data-capture-sdk/dotnet.android/id-capture/api/id-capture-region.html#enum-scandit.datacapture.id.IdCaptureRegion) enum to enable highly flexible document filtering.

For example, to accept only US Driver Licenses:

```csharp
settings.AcceptedDocuments = IdDocumentType.DriverLicense | IdDocumentType.Region.US;
settings.AcceptedDocuments = new List<IIdCaptureDocument> { new DriverLicense(IdCaptureRegion.Us) };
```

Or to accept all Passports *except* those from the US:

```csharp
settings.AcceptedDocuments = IdDocumentType.Passport;
settings.RejectedDocuments = IdDocumentType.Region.US;
settings.AcceptedDocuments = new List<IIdCaptureDocument> { new Passport(IdCaptureRegion.Any) };
settings.RejectedDocuments = new List<IIdCaptureDocument> { new Passport(IdCaptureRegion.Us) };
```

## ID Images
Expand Down
57 changes: 28 additions & 29 deletions docs/sdks/net/android/id-capture/get-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,15 @@ By default, [anonymized data](./advanced.md#configure-data-anonymization) is not
```csharp
IdCaptureSettings settings = new IdCaptureSettings
{
AcceptedDocuments = IdDocumentType.Passport | IdDocumentType.DriverLicense,
RejectedDocuments = IdDocumentType.IdCard,
AcceptedDocuments = new List<IIdCaptureDocument>
{
new Passport(IdCaptureRegion.Any),
new DriverLicense(IdCaptureRegion.Any),
},
RejectedDocuments = new List<IIdCaptureDocument>
{
new IdCard(IdCaptureRegion.Any),
},
};
```

Expand All @@ -86,59 +93,51 @@ Capture results are delivered as a [CapturedId](https://docs.scandit.com/data-ca
For more specific information, use its non-null result properties (e.g. [CapturedId.barcode](https://docs.scandit.com/data-capture-sdk/dotnet.android/id-capture/api/captured-id.html#property-scandit.datacapture.id.CapturedId.Barcode)).

```csharp
public class MyListener : Java.Lang.Object, IIdCaptureListener
public class MyListener : IIdCaptureListener
{
public void OnIdCaptured(IdCapture mode, IdCaptureSession session, IFrameData data)
public void OnIdCaptured(IdCapture capture, CapturedId capturedId)
{
CapturedId capturedId = session.NewlyCapturedId;

// The recognized fields of the captured ID can vary based on the type.
if (capturedId.CapturedResultType == CapturedResultType.MrzResult)
if (capturedId.Mrz != null)
{
// Handle the information extracted.
// Handle the information extracted from the MRZ.
}
else if (capturedId.CapturedResultType == CapturedResultType.VizResult)
else if (capturedId.Viz != null)
{
// Handle the information extracted.
// Handle the information extracted from the VIZ.
}
else if (capturedId.CapturedResultType == CapturedResultType.BarcodeResult)
else if (capturedId.Barcode != null)
{
// Handle the information extracted.
// Handle the information extracted from the barcode.
}
}

public void OnErrorEncountered(IdCapture mode, Throwable error, IdCaptureSession session, IFrameData data)
public void OnIdRejected(IdCapture capture, CapturedId? capturedId, RejectionReason reason)
{
// Implement to handle an error encountered during the capture process.
// Implement to handle a document rejected by IdCapture.
}

public void OnObservationStarted(IdCapture mode)
{ }

public void OnObservationStopped(IdCapture mode)
{ }
}
```

Alternatively to register [IIdCaptureListener](https://docs.scandit.com/data-capture-sdk/dotnet.android/id-capture/api/id-capture-listener.html#interface-scandit.datacapture.id.IIdCaptureListener) interface it is possible to subscribe to corresponding events. For example:

```csharp
idCapture.IdCaptured += (object sender, IdCaptureEventArgs args) =>
idCapture.IdCaptured += (object sender, IdCapturedEventArgs args) =>
{
CapturedId capturedId = args.Session.NewlyCapturedId;
CapturedId capturedId = args.CapturedId;

// The recognized fields of the captured ID can vary based on the type.
if (capturedId.CapturedResultType == CapturedResultType.MrzResult)
if (capturedId.Mrz != null)
{
// Handle the information extracted.
// Handle the information extracted from the MRZ.
}
else if (capturedId.CapturedResultType == CapturedResultType.VizResult)
else if (capturedId.Viz != null)
{
// Handle the information extracted.
// Handle the information extracted from the VIZ.
}
else if (capturedId.CapturedResultType == CapturedResultType.BarcodeResult)
else if (capturedId.Barcode != null)
{
// Handle the information extracted.
// Handle the information extracted from the barcode.
}
};
```
Expand All @@ -157,7 +156,7 @@ When using the built-in camera as [frameSource](https://docs.scandit.com/data-ca
To do that, add a [DataCaptureView](https://docs.scandit.com/data-capture-sdk/dotnet.android/core/api/ui/data-capture-view.html#class-scandit.datacapture.core.ui.DataCaptureView) to your view hierarchy:

```csharp
DataCaptureView dataCaptureView = DataCaptureView.Create(this, dataCaptureContext);
DataCaptureView dataCaptureView = DataCaptureView.Create(dataCaptureContext);
SetContentView(dataCaptureView);
```

Expand Down
18 changes: 15 additions & 3 deletions docs/sdks/net/android/label-capture/advanced.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ To customize the appearance of an overlay you can implement a [ILabelCaptureBasi
The method [BrushForLabel()](https://docs.scandit.com/data-capture-sdk/dotnet.android/label-capture/api/ui/label-capture-basic-overlay-listener.html#method-scandit.datacapture.label.ui.ILabelCaptureBasicOverlayListener.BrushForLabel) is called every time a label is captured, and [BrushForField()](https://docs.scandit.com/data-capture-sdk/dotnet.android/label-capture/api/ui/label-capture-basic-overlay-listener.html#method-scandit.datacapture.label.ui.ILabelCaptureBasicOverlayListener.BrushForField) is called for each of its fields to determine the brush for the label or field.

```csharp
public class BasicOverlayListener : Java.Lang.Object, ILabelCaptureBasicOverlayListener
public class BasicOverlayListener : ILabelCaptureBasicOverlayListener
{
private readonly Context context;

Expand Down Expand Up @@ -103,7 +103,7 @@ dataCaptureView.AddOverlay(advancedOverlay);
// Configure the advanced overlay with a listener that handles AR content creation and positioning
advancedOverlay.Listener = new AdvancedOverlayListener(this);

public class AdvancedOverlayListener : Java.Lang.Object, ILabelCaptureAdvancedOverlayListener
public class AdvancedOverlayListener : ILabelCaptureAdvancedOverlayListener
{
private readonly Context context;

Expand Down Expand Up @@ -227,7 +227,7 @@ validationFlowOverlay.Listener = new ValidationFlowListener();
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 [ILabelCaptureValidationFlowListener](https://docs.scandit.com/data-capture-sdk/dotnet.android/label-capture/api/ui/label-capture-validation-flow-listener.html) interface:

```csharp
public class ValidationFlowListener : Java.Lang.Object, ILabelCaptureValidationFlowListener
public class ValidationFlowListener : ILabelCaptureValidationFlowListener
{
// This is called by the validation flow overlay when a label has been fully captured and validated
public void OnValidationFlowLabelCaptured(IList<LabelField> fields)
Expand All @@ -249,6 +249,18 @@ public class ValidationFlowListener : Java.Lang.Object, ILabelCaptureValidationF

// Process the captured and validated data
}

// Called when the user manually submits a value for a field through the validation flow UI
public void OnManualInputSubmitted(LabelField field, string? oldValue, string newValue)
{
// Handle the manual input submission, e.g. for analytics
}

// Called when the validation flow results are updated (for both sync and async scanning)
public void OnValidationFlowResultUpdate(LabelResultUpdateType type, long asyncId, IList<LabelField> fields, IFrameData? frameData)
{
// Handle intermediate result updates during the validation flow
}
}
```

Expand Down
4 changes: 2 additions & 2 deletions docs/sdks/net/android/label-capture/get-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ To get informed whenever a new label has been recognized, add a [ILabelCaptureLi
First implement the `ILabelCaptureListener` interface. Here is an example of how to implement a listener that processes the captured labels based on the label capture settings defined above:

```csharp
public class LabelCaptureRepository : Java.Lang.Object, ILabelCaptureListener
public class LabelCaptureRepository : ILabelCaptureListener
{
public void OnSessionUpdated(LabelCapture labelCapture, LabelCaptureSession session, IFrameData frameData)
{
Expand Down Expand Up @@ -183,7 +183,7 @@ Here is an example of how to add a `LabelCaptureBasicOverlay` to the `DataCaptur
/*
* Create the data capture view and attach it to the data capture context created earlier.
*/
var dataCaptureView = DataCaptureView.Create(this, dataCaptureContext);
var dataCaptureView = DataCaptureView.Create(dataCaptureContext);

/*
* Add the data capture view to your view hierarchy
Expand Down
Loading
Loading