Skip to content

Commit 597f0da

Browse files
Merge pull request #398 from dynamsoft-docs/preview
Preview
2 parents abe829c + e2a4b6e commit 597f0da

11 files changed

Lines changed: 476 additions & 36 deletions

File tree

_data/product_version.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ useGroupedVersion: true
33
version_info_list_mobile:
44
- value: latest version
55
- value: 10.x_android_ios_maui
6-
- value: 9.x or older_android_ios
6+
- value: 9.x_android_ios

_includes/android_sample_index.html

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@
398398
/* Scenario Cards Grid */
399399
.filetree .scenario-grid {
400400
display: grid;
401-
grid-template-columns: repeat(5, 1fr);
401+
grid-template-columns: repeat(4, 1fr);
402402
gap: 12px;
403403
margin: 1em 0;
404404
padding: 0;
@@ -738,6 +738,10 @@ <h2>Develop with Barcode Scanner Component</h2>
738738
<span class="scenario-name">Data Matrix</span>
739739
<img src="../../assets/samples/data_matrix.webp" alt="Data Matrix" class="scenario-icon">
740740
</a>
741+
<a href="https://github.com/Dynamsoft/barcode-reader-mobile-samples/tree/main/android/BarcodeScannerAPISamples/ScenarioOrientedSamples/src/main/assets/Templates/ReadPDF417.json" target="_blank" class="scenario-card" title="ReadPDF417.json">
742+
<span class="scenario-name">PDF417</span>
743+
<img src="../../assets/samples/pdf417.webp" alt="PDF417" class="scenario-icon">
744+
</a>
741745
<a href="https://github.com/Dynamsoft/barcode-reader-mobile-samples/tree/main/android/BarcodeScannerAPISamples/ScenarioOrientedSamples/src/main/assets/Templates/ReadCommon2D.json" target="_blank" class="scenario-card" title="ReadCommon2D.json">
742746
<span class="scenario-name">Common 2D Codes</span>
743747
<img src="../../assets/samples/common_2d.webp" alt="Common 2D Codes" class="scenario-icon">
@@ -767,6 +771,12 @@ <h2>Develop with Barcode Scanner Component</h2>
767771
<h2>Develop with Foundational APIs</h2>
768772
</div>
769773
<div class="children">
774+
<div class="file">
775+
<span data-balloon-length="large" data-balloon-pos="down" aria-label="Scan from a window and add the scanned item to the cart.">
776+
<span class="android-label">CartBuilder</span> -
777+
<a class="button title source-link" href="https://github.com/Dynamsoft/barcode-reader-mobile-samples/tree/main/android/FoundationalAPISamples/CartBuilder" title="View source code on GitHub">Source</a>
778+
</span>
779+
</div>
770780
<div class="file">
771781
<span data-balloon-length="large" data-balloon-pos="down" aria-label="Decode barcodes from an existing image file.">
772782
<span class="android-label">DecodeFromAnImage</span> -
@@ -809,6 +819,18 @@ <h2>Develop with Foundational APIs</h2>
809819
<a class="button title source-link" href="https://github.com/Dynamsoft/barcode-reader-mobile-samples/tree/main/android/FoundationalAPISamples/ReadGS1AI" title="View source code on GitHub">Source</a>
810820
</span>
811821
</div>
822+
<div class="file">
823+
<span data-balloon-length="large" data-balloon-pos="down" aria-label="Read all currently visible barcodes.">
824+
<span class="android-label">ReadMultipleBarcodes</span> -
825+
<a class="button title source-link" href="https://github.com/Dynamsoft/barcode-reader-mobile-samples/tree/main/android/FoundationalAPISamples/ReadMultipleBarcodes" title="View source code on GitHub">Source</a>
826+
</span>
827+
</div>
828+
<div class="file">
829+
<span data-balloon-length="large" data-balloon-pos="down" aria-label="Continuously read barcodes and add newly detected unique barcodes to the list.">
830+
<span class="android-label">ReadMultipleUniqueBarcodes</span> -
831+
<a class="button title source-link" href="https://github.com/Dynamsoft/barcode-reader-mobile-samples/tree/main/android/FoundationalAPISamples/ReadMultipleUniqueBarcodes" title="View source code on GitHub">Source</a>
832+
</span>
833+
</div>
812834
<div class="file">
813835
<span data-balloon-length="large" data-balloon-pos="down" aria-label="Optimize settings for scanning tiny or small barcodes.">
814836
<span class="android-label">TinyBarcodeDecoding</span> -

_includes/ios_sample_index.html

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@
429429
/* Scenario Cards Grid */
430430
.filetree .scenario-grid {
431431
display: grid;
432-
grid-template-columns: repeat(5, 1fr);
432+
grid-template-columns: repeat(4, 1fr);
433433
gap: 12px;
434434
margin: 1em 0;
435435
padding: 0;
@@ -766,6 +766,10 @@ <h2>Develop with Barcode Scanner Component</h2>
766766
<span class="scenario-name">Data Matrix</span>
767767
<img src="../../assets/samples/data_matrix.webp" alt="Data Matrix" class="scenario-icon">
768768
</a>
769+
<a href="https://github.com/Dynamsoft/barcode-reader-mobile-samples/tree/main/ios/BarcodeScannerAPISamples/ScenarioOrientedSamples/ScenarioOrientedSamples/DynamsoftResources.bundle/Templates/ReadPDF417.json" target="_blank" class="scenario-card" title="ReadPDF417.json">
770+
<span class="scenario-name">PDF417</span>
771+
<img src="../../assets/samples/pdf417.webp" alt="PDF417" class="scenario-icon">
772+
</a>
769773
<a href="https://github.com/Dynamsoft/barcode-reader-mobile-samples/tree/main/ios/BarcodeScannerAPISamples/ScenarioOrientedSamples/ScenarioOrientedSamples/DynamsoftResources.bundle/Templates/ReadCommon2D.json" target="_blank" class="scenario-card" title="ReadCommon2D.json">
770774
<span class="scenario-name">Common 2D Codes</span>
771775
<img src="../../assets/samples/common_2d.webp" alt="Common 2D Codes" class="scenario-icon">
@@ -795,6 +799,12 @@ <h2>Develop with Barcode Scanner Component</h2>
795799
<h2>Develop with Foundational APIs</h2>
796800
</div>
797801
<div class="children">
802+
<div class="file">
803+
<span data-balloon-length="large" data-balloon-pos="down" aria-label="Scan from a window and add the scanned item to the cart.">
804+
<span class="ios-label">CartBuilder</span> -
805+
<a class="button title source-link" href="https://github.com/Dynamsoft/barcode-reader-mobile-samples/tree/main/ios/FoundationalAPISamples/CartBuilder" title="View source code on GitHub">Source</a>
806+
</span>
807+
</div>
798808
<div class="file">
799809
<span data-balloon-length="large" data-balloon-pos="down" aria-label="Decode barcodes from an existing image file.">
800810
<span class="ios-label">DecodeFromAnImage</span> -
@@ -837,6 +847,18 @@ <h2>Develop with Foundational APIs</h2>
837847
<a class="button title source-link" href="https://github.com/Dynamsoft/barcode-reader-mobile-samples/tree/main/ios/FoundationalAPISamples/ReadGS1AI" title="View source code on GitHub">Source</a>
838848
</span>
839849
</div>
850+
<div class="file">
851+
<span data-balloon-length="large" data-balloon-pos="down" aria-label="Read all currently visible barcodes.">
852+
<span class="ios-label">ReadMultipleBarcodes</span> -
853+
<a class="button title source-link" href="https://github.com/Dynamsoft/barcode-reader-mobile-samples/tree/main/ios/FoundationalAPISamples/ReadMultipleBarcodes" title="View source code on GitHub">Source</a>
854+
</span>
855+
</div>
856+
<div class="file">
857+
<span data-balloon-length="large" data-balloon-pos="down" aria-label="Continuously read barcodes and add newly detected unique barcodes to the list.">
858+
<span class="ios-label">ReadMultipleUniqueBarcodes</span> -
859+
<a class="button title source-link" href="https://github.com/Dynamsoft/barcode-reader-mobile-samples/tree/main/ios/FoundationalAPISamples/ReadMultipleUniqueBarcodes" title="View source code on GitHub">Source</a>
860+
</span>
861+
</div>
840862
<div class="file">
841863
<span data-balloon-length="large" data-balloon-pos="down" aria-label="Optimize settings for scanning tiny or small barcodes.">
842864
<span class="ios-label">TinyBarcodeDecoding</span> -

_includes/sidelist-programming/programming-android.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<li lang="android" ><a href="{{ site.android }}user-guide/index.html" class="otherLinkColour">User Guide</a>
44
<ul lang="android" >
55
<li lang="android" ><a href="{{ site.android }}user-guide.html" class="otherLinkColour">Build your first APP</a></li>
6+
<li lang="android" ><a href="{{ site.android }}user-guide/understand-barcode-scan-results.html" class="otherLinkColour">Understand Barcode Scan Results</a></li>
67
<li lang="android" ><a href="{{ site.android }}user-guide/configure-barcode-scanner.html" class="otherLinkColour">Configure Barcode Scanner</a>
78
<ul lang="android" >
89
<li lang="android" ><a href="{{ site.android }}user-guide/scanner-barcode-formats.html" class="otherLinkColour">Specify Barcode Format</a></li>
@@ -41,7 +42,7 @@
4142
<li lang="android" ><a href="{{ site.features }}use-region-predetection.html?lang=android" class="otherLinkColour">Pre-detect Region of Interest (ROI)</a></li>
4243
</ul>
4344
</li>
44-
<li lang="android" ><a class="otherLinkColour">Barcode Results</a>
45+
<li lang="android" ><a href="{{ site.android }}user-guide/understand-barcode-results.html" class="otherLinkColour">Understand Barcode Results</a>
4546
<ul lang="android" >
4647
<li lang="android" ><a href="{{ site.features }}get-confidence-rotation.html?lang=android" class="otherLinkColour">Get barcode confidence and rotation</a></li>
4748
<li lang="android" ><a href="{{ site.features }}get-barcode-location.html?lang=android" class="otherLinkColour">Get barcode location</a></li>

_includes/sidelist-programming/programming-oc.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
<li lang="objectivec-swift" ><a href="{{ site.oc }}user-guide/index.html" class="otherLinkColour">User Guide</a>
55
<ul lang="objectivec-swift" >
66
<li lang="objectivec-swift" ><a href="{{ site.oc }}user-guide.html" class="otherLinkColour">Build your first APP</a> </li>
7+
<li lang="objectivec-swift" ><a href="{{ site.oc }}user-guide/understand-barcode-scan-results.html" class="otherLinkColour">Understand Barcode Scan Results</a></li>
78
<li lang="objectivec-swift" ><a href="{{ site.oc }}user-guide/configure-barcode-scanner.html" class="otherLinkColour">Configure Barcode Scanner</a>
89
<ul lang="objectivec-swift" >
910
<li lang="objectivec-swift" ><a href="{{ site.oc }}user-guide/scanner-barcode-formats.html" class="otherLinkColour">Specify Barcode Format</a></li>
@@ -43,7 +44,7 @@
4344
<li lang="objectivec-swift" ><a href="{{ site.features }}use-region-predetection.html?lang=objc,swift" class="otherLinkColour">Pre-detect Region of Interest (ROI)</a></li>
4445
</ul>
4546
</li>
46-
<li lang="objectivec-swift" ><a class="otherLinkColour">Barcode Results</a>
47+
<li lang="objectivec-swift" ><a href="{{ site.oc }}user-guide/understand-barcode-results.html" class="otherLinkColour">Understand Barcode Results</a>
4748
<ul lang="objectivec-swift" >
4849
<li lang="objectivec-swift" ><a href="{{ site.features }}get-confidence-rotation.html?lang=objc,swift" class="otherLinkColour">Get barcode confidence and rotation</a></li>
4950
<li lang="objectivec-swift" ><a href="{{ site.features }}get-barcode-location.html?lang=objc,swift" class="otherLinkColour">Get barcode location</a></li>

programming/android/user-guide/understand-barcode-results.md

Lines changed: 112 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -8,34 +8,115 @@ needGenerateH3Content: true
88
noTitleIndex: true
99
---
1010

11-
# Understand Barcode Results
12-
13-
- `Barcodes`
14-
- `BarcodeResultItem`
15-
- `ResultStatus`
16-
- `ErrorCode`
17-
- `ErrorString`
18-
19-
- `BarcodeResultItem`
20-
- Format
21-
- FormatString
22-
- Text
23-
- byte[] Bytes
24-
- Quadrilateral Location
25-
- Point[] Points
26-
- int Confidence
27-
- int Angle
28-
- int ModuleSize
29-
- BarcodeDetails Details
30-
- AztecDetails
31-
- QRCodeDetails
32-
- OneDCodeDetails
33-
- DataMatrixDetails
34-
- PDF417Details
35-
- boolean isDPM
36-
- boolean isMirrored
37-
- ECISegment[] ECISegments
38-
- eciValue
39-
- charsetEncoding
40-
- startIndex
41-
- length
11+
# Understanding Barcode Results
12+
13+
`DecodedBarcodesResult` is the barcode-type result returned by the Dynamsoft Barcode Reader SDK. It represents all barcode-related information captured from a single image or video frame.
14+
15+
It contains:
16+
17+
- All decoded barcodes.
18+
- Metadata about the original image.
19+
- Error information when a failure occurs.
20+
- A rotation transformation matrix if the original image includes rotation info.
21+
22+
```java
23+
mRouter.addResultReceiver(new CapturedResultReceiver() {
24+
@Override
25+
public void onDecodedBarcodesReceived(@NonNull DecodedBarcodesResult result) {
26+
if (result.getItems().length!=0)
27+
{
28+
for(BarcodeResultItem item:result.getItems())
29+
{
30+
String barcodeText = barcodeResultItem.getText();
31+
String barcodeFormatString = barcodeResultItem.getFormatString();
32+
}
33+
}
34+
}
35+
});
36+
```
37+
38+
## How to Use
39+
40+
### Check Error Messages
41+
42+
Error messages are typically caused by:
43+
44+
- The barcode reading task is not working properly.
45+
- The operation timeout.
46+
47+
```java
48+
mRouter.addResultReceiver(new CapturedResultReceiver() {
49+
@Override
50+
public void onDecodedBarcodesReceived(@NonNull DecodedBarcodesResult result) {
51+
if (result.getErrorCode()!= EnumErrorCode.EC_OK)
52+
{
53+
// Handle the error.
54+
}
55+
}
56+
});
57+
```
58+
59+
> [!Note]
60+
> You might still receive barcode results even when the error message is not empty.
61+
62+
### Access decoded barcodes
63+
64+
Each decoded barcode is a `BarcodeResultItem` from `result.getBarcodes`. The following is an example:
65+
66+
![barcode-result-item](../../assets/barcode-result-item.png)
67+
68+
| BarcodeResultItem | |
69+
| ----------------- | -- |
70+
| `format` | 67108864 |
71+
| `formatString` | QR_CODE |
72+
| `text` | www.dynamsoft.com |
73+
| `bytes` | [119],[119],[119],[46],[100],[121],...... |
74+
| `location` | Point(196, 1101), Point(518, 1000),...... |
75+
| `confidence` | 86 |
76+
| `angle` | 345 |
77+
| `moduleSize` | 10 |
78+
| `isDPM` | FALSE |
79+
| `isMirrored` | FALSE |
80+
| `details` | rows = 2<br>columns = 2<br>errorCorrectionLevel = L<br>version = 2<br>model = 2<br>mode = 7<br>page = -1<br>totalPage = -1<br>parityData = 0<br>dataMaskPattern = 2<br>codewords = ...... |
81+
82+
### Common fields to use
83+
84+
- `text`: The decoded string. This is the most common field used for downstream processing.
85+
- `formatString`: The barcode symbology (for example, `QR_CODE`, `EAN_13`).
86+
- `bytes`: Raw payload bytes. By default, barcode text is interpreted using ISO-8859-1. Use this when the payload contains binary data or requires custom decoding.
87+
- `location`: Corner points of the barcode in the image, useful for drawing overlays.
88+
- `confidence`: A confidence score. Higher values indicate more reliable decoding.
89+
- `details`: Symbology-specific details (varies by barcode type).
90+
91+
### Access the Original Image
92+
93+
The original image is not returned by default. In `onDecodedBarcodesReceived`, you receive the original image `HashId`. Use it to fetch the image when needed.
94+
95+
**Code Snippet**
96+
97+
```java
98+
mRouter.addResultReceiver(new CapturedResultReceiver() {
99+
@Override
100+
public void onDecodedBarcodesReceived(@NonNull DecodedBarcodesResult result) {
101+
ImageData originalImage = mRouter.getIntermediateResultManager().getOriginalImage(result.getOriginalImageHashId());
102+
}
103+
});
104+
```
105+
106+
> [!Note]
107+
> Use `originalImage` within the lifecycle of each `onDecodedBarcodesReceived` callback. Otherwise, it may be released or replaced by a newer image.
108+
109+
**Related APIs**
110+
111+
- [`getOriginalImageHashId`]({{ site.dbr_android_api }}decoded-barcodes-result.html)
112+
- [`getIntermediateResultManager`]({{ site.dcvb_android_api }}capture-vision-router/intermediate-result.html#getintermediateresultmanager)
113+
- [`getOriginalImage`]({{ site.dcvb_android_api }}capture-vision-router/auxiliary-classes/intermediate-result-manager.html#getoriginalimage)
114+
115+
## Explore Result Details
116+
117+
This page provides a high-level overview of barcode scan results. For detailed usage and advanced scenarios, see:
118+
119+
- [Get barcode confidence and rotation]({{ site.features }}get-confidence-rotation.html?lang=android)
120+
- [Get barcode location]({{ site.features }}get-barcode-location.html?lang=android)
121+
- [Get detailed barcode information]({{ site.features }}get-detailed-info.html?lang=android)
122+
- [Filter and sort decoding results]({{ site.features }}filter-and-sort.html?lang=android)
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
---
2+
layout: default-layout
3+
title: Understand Barcode Results - Dynamsoft Barcode Reader for Android
4+
description: Understand the structure of the barcode decoding results of Dynamsoft Barcode Reader Android.
5+
keywords: understand results, Android
6+
needAutoGenerateSidebar: true
7+
needGenerateH3Content: true
8+
noTitleIndex: true
9+
---
10+
11+
# Understanding Barcode Scan Results
12+
13+
`BarcodeScanResult` is the object returned by the `onScanResult` callback when a scanning session finishes, is canceled, or encounters an error. Every `BarcodeScanResult` contains a `resultStatus` and a list of barcodes.
14+
The barcode list is non-empty only when `resultStatus` is `RS_FINISHED`.
15+
16+
```java
17+
launcher = registerForActivityResult(
18+
new BarcodeScannerActivity.ResultContract(),
19+
result -> {
20+
// User code for using the the scan result.
21+
}
22+
);
23+
```
24+
25+
## How to Use
26+
27+
### Check Status and Error Messages
28+
29+
Always check `resultStatus` before accessing the decoded barcodes.
30+
31+
- `RS_FINISHED`: Scanning completed successfully. At least one barcode is available.
32+
- `RS_CANCELED` / `RS_EXCEPTION`: No barcodes are returned.
33+
34+
`RS_EXCEPTION` might be caused by:
35+
36+
- You configured an invalid or expired license via `setLicense`.
37+
- You configured an invalid template via `setTemplateFile`.
38+
39+
### Access decoded barcodes
40+
41+
Each decoded barcode is a `BarcodeResultItem` from `result.getBarcodes()`. The following is an example of a `BarcodeResultItem`:
42+
43+
![barcode-result-item](../../assets/barcode-result-item.png)
44+
45+
| BarcodeResultItem | |
46+
| ----------------- | -- |
47+
| `format` | 67108864 |
48+
| `formatString` | QR_CODE |
49+
| `text` | www.dynamsoft.com |
50+
| `bytes` | [119],[119],[119],[46],[100],[121],...... |
51+
| `location` | Point(196, 1101), Point(518, 1000),...... |
52+
| `confidence` | 86 |
53+
| `angle` | 345 |
54+
| `moduleSize` | 10 |
55+
| `isDPM` | FALSE |
56+
| `isMirrored` | FALSE |
57+
| `details` | rows = 2<br>columns = 2<br>errorCorrectionLevel = L<br>version = 2<br>model = 2<br>mode = 7<br>page = -1<br>totalPage = -1<br>parityData = 0<br>dataMaskPattern = 2<br>codewords = ...... |
58+
59+
### Common fields to use
60+
61+
- `text`: The decoded string. This is the most common field used for downstream processing.
62+
- `formatString`: The barcode symbology (for example, `QR_CODE`, `EAN_13`).
63+
- `bytes`: Raw bytes of the barcode payload. By default, barcode text is interpreted using ISO-8859-1. Use this field when the payload contains binary data or requires custom decoding.
64+
- `location`: Corner points of the barcode in the image, useful for drawing overlays.
65+
- `confidence`: A confidence score. Higher values indicate more reliable decoding.
66+
- `details`: Symbology-specific details (varies by barcode type).
67+
68+
## Explore Result Details
69+
70+
This page provides a high-level overview of barcode scan results.
71+
For more detailed usage and advanced scenarios, see the following topics:
72+
73+
- [Get barcode confidence and rotation]({{ site.features }}get-confidence-rotation.html?lang=android)
74+
- [Get barcode location]({{ site.features }}get-barcode-location.html?lang=android)
75+
- [Get detailed barcode information]({{ site.features }}get-detailed-info.html?lang=android)
76+
- [Filter and sort decoding results]({{ site.features }}filter-and-sort.html?lang=android)
25.5 KB
Loading
994 Bytes
Loading

0 commit comments

Comments
 (0)