Skip to content

Commit d891a85

Browse files
Updating Android Sidelist
1 parent df6e796 commit d891a85

5 files changed

Lines changed: 384 additions & 45 deletions

File tree

_includes/sidelist-programming/programming-android.html

Lines changed: 46 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,40 @@
1-
<li lang="android" class="category">Develop With Ready-to-use UI</li>
2-
3-
<li lang="android"><a href="{{ site.android }}user-guide/index.html" class="otherLinkColour">User Guide</a>
1+
<li lang="android" class="category">DEVELOPMENT</li>
2+
<li lang="android"><a href="{{ site.android }}user-guide/index.html" class="otherLinkColour">Get Started</a>
43
<ul lang="android">
5-
<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-results.html" class="otherLinkColour">Understanding Barcode Scan Results</a></li>
7-
<li lang="android"><a href="{{ site.android }}user-guide/configure-barcode-scanner.html" class="otherLinkColour">Configure Barcode Scanner</a>
8-
<ul lang="android">
9-
<li lang="android"><a href="{{ site.android }}user-guide/scanner-barcode-formats.html" class="otherLinkColour">Specify Barcode Format</a></li>
10-
<li lang="android"><a href="{{ site.android }}user-guide/scanner-multi-barcodes.html" class="otherLinkColour">Switch Single & Multiple Scanning Modes</a></li>
11-
<li lang="android"><a href="{{ site.android }}user-guide/scanner-improve-performance.html" class="otherLinkColour">Improve the Performance</a></li>
12-
<li lang="android"><a href="{{ site.android }}user-guide/scanner-customize-ui.html" class="otherLinkColour">Customize the Scanner UI</a></li>
13-
<li lang="android"><a href="{{ site.android }}user-guide/scanner-additional-settings.html" class="otherLinkColour">Add Additional Settings</a></li>
14-
</ul>
15-
</li>
4+
<li lang="android"><a href="{{ site.android }}user-guide.html" class="otherLinkColour">Quick Start</a></li>
5+
<li lang="android"><a href="{{ site.android }}foundational-guide.html" class="otherLinkColour">Build with Foundational API</a></li>
166
</ul>
177
</li>
18-
<li lang="android"><a href="{{ site.android }}samples/rtu-samples.html" class="otherLinkColour">Demo &amp; Samples</a></li>
198

20-
<li lang="android"><a href="{{ site.dbr_android_api }}barcode-scanner/index.html" class="otherLinkColour">API References</a>
21-
<ul lang="android">
22-
<li lang="android"><a>Classes</a>
9+
<li lang="android"><a href="{{ site.android }}user-guide/index.html" class="otherLinkColour">Core Concepts</a>
10+
<ul>
11+
<li><a href="{{ site.android }}user-guide/concept/scanner-barcode-formats.html" class="otherLinkColour">Barcode Formats</a></li>
12+
<li><a href="{{ site.android }}user-guide/concept/parameters-and-templates.html" class="otherLinkColour">Settings, Parameters & Templates</a></li>
13+
<li><a href="{{ site.android }}user-guide/understand-barcode-results.html" class="otherLinkColour">Understanding Barcode Results</a></li>
14+
</ul>
15+
</li>
16+
17+
<li lang="android"><a href="{{ site.android }}user-guide/index.html" class="otherLinkColour">Capabilities</a>
18+
<ul>
19+
<li lang="android"><a class="otherLinkColour">Input</a>
2320
<ul lang="android">
24-
<li lang="android"><a href="{{ site.dbr_android_api }}barcode-scanner/barcode-scanner-activity.html" class="otherLinkColour">BarcodeScannerActivity</a></li>
25-
<li lang="android"><a href="{{ site.dbr_android_api }}barcode-scanner/barcode-scanner-config.html" class="otherLinkColour">BarcodeScannerConfig</a></li>
26-
<li lang="android"><a href="{{ site.dbr_android_api }}barcode-scanner/barcode-scan-result.html" class="otherLinkColour">BarcodeScanResult</a></li>
21+
<li lang="android"><a href="{{ site.android }}user-guide/capabilities/read-from-camera.html" class="otherLinkColour">Read from Camera</a></li>
22+
<li lang="android"><a href="{{ site.android }}user-guide/capabilities/read-from-image.html" class="otherLinkColour">Read from Image</a></li>
2723
</ul>
2824
</li>
29-
<li lang="android"><a class="otherLinkColour">Enumerations</a>
25+
<li lang="android"><a href="{{ site.features }}get-detailed-info.html?lang=android" class="otherLinkColour">Working with Results</a>
3026
<ul lang="android">
31-
<li lang="android"><a href="{{ site.dbr_android_api }}barcode-scanner/enum-result-status.html?lang=android" class="otherLinkColour">EnumResultStatus</a></li>
32-
<li lang="android"><a href="{{ site.dbr_android_api }}barcode-scanner/enum-scanning-mode.html?lang=android" class="otherLinkColour">EnumScanningMode</a></li>
27+
<li lang="android"><a href="{{ site.features }}get-detailed-info.html?lang=android" class="otherLinkColour">Get detailed barcode information</a></li>
28+
<li lang="android"><a href="{{ site.features }}filter-and-sort.html?lang=android" class="otherLinkColour">Filter and sort decoding results</a></li>
3329
</ul>
3430
</li>
35-
</ul>
36-
</li>
37-
38-
<li lang="android" class="category">Develop With Foundational APIs</li>
39-
40-
<li lang="android"><a href="{{ site.android }}user-guide/index.html" class="otherLinkColour">User Guide</a>
41-
<ul lang="android">
42-
<li lang="android"><a href="{{ site.android }}foundational-guide.html" class="otherLinkColour">Build Your First APP</a></li>
43-
<li lang="android"><a href="{{ site.android }}user-guide/explore-features/read-from-an-image.html" class="otherLinkColour">Read from an Image</a></li>
44-
<li lang="android"><a href="{{ site.android }}user-guide/understand-barcode-results.html" class="otherLinkColour">Understand Barcode Results</a>
31+
<li lang="android"><a href="{{ site.features }}get-detailed-info.html?lang=android" class="otherLinkColour">Control the Scanning Process</a>
4532
<ul lang="android">
46-
<li lang="android"><a href="{{ site.features }}get-confidence-rotation.html?lang=android" class="otherLinkColour">Get barcode confidence and rotation</a></li>
47-
<li lang="android"><a href="{{ site.features }}get-barcode-location.html?lang=android" class="otherLinkColour">Get barcode location</a></li>
48-
<li lang="android"><a href="{{ site.features }}get-detailed-info.html?lang=android" class="otherLinkColour">Get detailed barcode information</a></li>
49-
<li lang="android"><a href="{{ site.features }}filter-and-sort.html?lang=android" class="otherLinkColour">Filter and sort decoding results</a></li>
33+
<li lang="android"><a href="{{ site.android }}user-guide/capabilities/read-from-camera.html" class="otherLinkColour">Configure Barcode Format</a></li>
34+
<li lang="android"><a href="{{ site.features }}barcode-scan-region-mobile.html?lang=android" class="otherLinkColour">Read a specific area/region</a></li>
5035
</ul>
5136
</li>
52-
<li lang="android"><a href="{{ site.android }}user-guide/explore-features/parameter-and-settings.html" class="otherLinkColour">Parameter Settings & Templates</a></li>
53-
<li lang="android"><a href="{{ site.features }}barcode-formats-and-count.html?lang=android" class="otherLinkColour">Specify barcode formats and count</a></li>
54-
<li lang="android"><a href="{{ site.features }}barcode-scan-region-mobile.html?lang=android" class="otherLinkColour">Read a specific area/region</a></li>
55-
<li lang="android"><a href="{{ site.android }}ui-configurations.html" class="otherLinkColour">Customize the UI</a></li>
56-
<li lang="android"><a class="otherLinkColour">Handle Challenging Barcodes</a>
37+
<li lang="android"><a class="otherLinkColour">Decode Challenging Barcodes</a>
5738
<ul lang="android">
5839
<li lang="android"><a href="{{ site.features }}read-inverted-barcodes.html?lang=android" class="otherLinkColour">Read inverted barcodes</a></li>
5940
<li lang="android"><a href="{{ site.features }}read-deformed-barcodes.html?lang=android" class="otherLinkColour">Read deformed barcodes</a></li>
@@ -70,8 +51,28 @@
7051
<li lang="android"><a href="{{ site.features }}use-format-specific-configuration.html?lang=android" class="otherLinkColour">Use format specific configurations</a></li>
7152
</ul>
7253
</li>
54+
<li lang="android"><a href="{{ site.android }}ui-configurations.html" class="otherLinkColour">Customize the UI</a></li>
7355
</ul>
7456
</li>
57+
58+
<!-- <li lang="android"><a href="{{ site.android }}user-guide/index.html" class="otherLinkColour">Scanner Customization</a>
59+
<ul lang="android">
60+
<li lang="android"><a href="{{ site.android }}user-guide/scanner-barcode-formats.html" class="otherLinkColour">Configure Barcode Formats</a></li>
61+
<li lang="android"><a href="{{ site.android }}user-guide/scanner-multi-barcodes.html" class="otherLinkColour">Single & Multiple Modes</a></li>
62+
<li lang="android"><a href="{{ site.android }}user-guide/scanner-improve-performance.html" class="otherLinkColour">Improve Performance</a></li>
63+
<li lang="android"><a href="{{ site.android }}user-guide/scanner-customize-ui.html" class="otherLinkColour">Customize Scanner UI</a></li>
64+
<li lang="android"><a href="{{ site.android }}user-guide/scanner-additional-settings.html" class="otherLinkColour">Additional Settings</a></li>
65+
</ul>
66+
</li>
67+
<li lang="android"><a href="{{ site.android }}user-guide/index.html" class="otherLinkColour">Advanced Customization</a>
68+
<ul lang="android">
69+
<li lang="android"><a href="{{ site.android }}user-guide/explore-features/parameters-and-settings.html?lang=android" class="otherLinkColour">Basic Configurations</a>
70+
<ul lang="android">
71+
</ul>
72+
</li>
73+
</ul>
74+
</li> -->
75+
7576
<li lang="android"><a href="{{ site.android }}samples/index.html" class="otherLinkColour">Demo &amp; Samples</a></li>
7677

7778
<li lang="android"><a href="{{ site.dbr_android_api }}" class="otherLinkColour">Foundational APIs</a>
@@ -696,8 +697,8 @@
696697
</li>
697698

698699
<li lang="android"><a href="{{ site.android }}user-guide/license-activation.html" class="otherLinkColour">License Initialization</a></li>
699-
<li lang="android" ><a href="{{ site.android }}migrate-from-v10/" class="otherLinkColour">Migrate from v10 to v11</a></li>
700-
<li lang="android" ><a href="{{ site.android }}migrate-from-v9/" class="otherLinkColour">Migrate from v9 to v11</a></li>
700+
<li lang="android"><a href="{{ site.android }}migrate-from-v10/" class="otherLinkColour">Migrate from v10 to v11</a></li>
701+
<li lang="android"><a href="{{ site.android }}migrate-from-v9/" class="otherLinkColour">Migrate from v9 to v11</a></li>
701702

702703
<li lang="android"><a href="https://www.dynamsoft.com/faq/barcode-reader/index.html" class="otherLinkColour">FAQ</a></li>
703704

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
---
2+
layout: default-layout
3+
title: Barcode Formats - Dynamsoft Barcode Reader for Android User Guide
4+
description: This page introduces the barcode format configuration feature of Dynamsoft Barcode Reader Android SDK.
5+
keywords: barcode formats, Android, java, kotlin
6+
noTitleIndex: true
7+
needGenerateH3Content: true
8+
needAutoGenerateSidebar: true
9+
---
10+
11+
# Configure Barcode Formats
12+
13+
Here are 2 ways for configuring barcode formats:
14+
15+
- Configure formats in code.
16+
- Configure formats together with other settings in the template.
17+
18+
## Configure Formats in Your Code
19+
20+
You specify barcode formats using a combined value of [`EnumBarcodeFormat`]({{ site.dbr_android_api }}enum/barcode-format.html).
21+
22+
- Use bitwise OR (`|`) to combine multiple formats.
23+
- `EnumBarcodeFormat.BF_DEFAULT` includes all common formats. (BF_ONED, BF_GS1_DATABAR, BF_PDF417, BF_QR_CODE, BF_DATAMATRIX, BF_AZTEC, BF_MAXICODE, BF_MICRO_QR, BF_MICRO_PDF417, BF_GS1_COMPOSITE)
24+
- Use `EnumBarcodeFormat.BF_ALL` to enable all supported formats.
25+
- Use group values like `EnumBarcodeFormat.BF_ONED` when appropriate.
26+
27+
### BarcodeScanner API
28+
29+
- `BarcodeScannerConfig.setBarcodeFormats(long format)`
30+
31+
Example:
32+
33+
```java
34+
BarcodeScannerConfig config = new BarcodeScannerConfig();
35+
// QR Code + DataMatrix
36+
config.setBarcodeFormats(EnumBarcodeFormat.BF_QR_CODE | EnumBarcodeFormat.BF_DATAMATRIX);
37+
```
38+
39+
### Foundational API
40+
41+
- `SimplifiedCaptureVisionSettings.barcodeSettings.barcodeFormatIds`
42+
43+
Example:
44+
45+
```java
46+
try {
47+
SimplifiedCaptureVisionSettings settings = mRouter.getSimplifiedSettings(EnumPresetTemplate.PT_READ_BARCODES);
48+
SimplifiedBarcodeReaderSettings barcodeSettings = settings.barcodeSettings;
49+
// Only read QR Code.
50+
barcodeSettings.barcodeFormatIds = EnumBarcodeFormat.BF_QR_CODE | EnumBarcodeFormat.BF_DATAMATRIX;
51+
mRouter.updateSettings(EnumPresetTemplate.PT_READ_BARCODES, settings);
52+
} catch (CaptureVisionRouterException e) {
53+
throw new RuntimeException(e);
54+
}
55+
```
56+
57+
> [!Note]
58+
> If you are already using a customized template, you usually don't need to specify formats again in code. Read more about [Use a Customized Template](parameters-and-templates.md#use-a-customized-template).
59+
60+
## Configure Formats in a Template
61+
62+
Barcode formats are specified in `BarcodeFormatIds` of `BarcodeReaderTaskSettingOptions`. For example:
63+
64+
```json
65+
{
66+
"CaptureVisionTemplates": [
67+
{
68+
"ImageROIProcessingNameArray": [ "ROI_2D" ],
69+
"Name": "ReadCommon2D",
70+
}
71+
],
72+
"TargetROIDefOptions": [
73+
{
74+
"Name": "ROI_2D",
75+
"TaskSettingNameArray": [ "Task_2D" ]
76+
}
77+
],
78+
"BarcodeReaderTaskSettingOptions": [
79+
{
80+
"Name": "Task_2D",
81+
"BarcodeFormatIds": [ "BF_QR_CODE", "BF_DATAMATRIX", "BF_PDF417", "BF_MAXICODE" ],
82+
"SectionArray": [
83+
{
84+
"Section": "ST_BARCODE_LOCALIZATION",
85+
"ImageParameterName": "ip"
86+
},
87+
{
88+
"Section": "ST_BARCODE_DECODING",
89+
"ImageParameterName": "ip"
90+
}
91+
]
92+
}
93+
],
94+
"ImageParameterOptions": [
95+
{
96+
"Name": "ip"
97+
}
98+
]
99+
}
100+
```
101+
102+
For common formats, you can download and use the preset templates below:
103+
104+
| Barcode Format(s) | Template |
105+
| ----------------- | -------- |
106+
| EAN13, EAN8, UPC_A, UPC_E, GS1 Databar | [ReadOneDRetail.json](https://github.com/Dynamsoft/barcode-reader-mobile-samples/blob/main/android/BarcodeScannerAPISamples/ScenarioOrientedSamples/src/main/assets/Templates/ReadOneDRetail.json) |
107+
| Code128, Code39, ITF, Codabar, MSI Code | [ReadOneDIndustrial.json](https://github.com/Dynamsoft/barcode-reader-mobile-samples/blob/main/android/BarcodeScannerAPISamples/ScenarioOrientedSamples/src/main/assets/Templates/ReadOneDIndustrial.json) |
108+
| QR Code | [ReadQR.json](https://github.com/Dynamsoft/barcode-reader-mobile-samples/blob/main/android/BarcodeScannerAPISamples/ScenarioOrientedSamples/src/main/assets/Templates/ReadQR.json) |
109+
| Data Matrix | [ReadDataMatrix.json](https://github.com/Dynamsoft/barcode-reader-mobile-samples/blob/main/android/BarcodeScannerAPISamples/ScenarioOrientedSamples/src/main/assets/Templates/ReadDataMatrix.json) |
110+
| PDF417 | [ReadPDF417.json](https://github.com/Dynamsoft/barcode-reader-mobile-samples/blob/main/android/BarcodeScannerAPISamples/ScenarioOrientedSamples/src/main/assets/Templates/ReadPDF417.json) |
111+
| Aztec | [ReadAztec.json](https://github.com/Dynamsoft/barcode-reader-mobile-samples/blob/main/android/BarcodeScannerAPISamples/ScenarioOrientedSamples/src/main/assets/Templates/ReadAztec.json) |
112+
| QR Code, Data Matrix, PDF417 | [ReadCommon2D.json](https://github.com/Dynamsoft/barcode-reader-mobile-samples/blob/main/android/BarcodeScannerAPISamples/ScenarioOrientedSamples/src/main/assets/Templates/ReadCommon2D.json) |
113+
| DotCode | [ReadDotCode.json](https://github.com/Dynamsoft/barcode-reader-mobile-samples/blob/main/android/BarcodeScannerAPISamples/ScenarioOrientedSamples/src/main/assets/Templates/ReadDotCode.json) |
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
---
2+
layout: default-layout
3+
title: Read from an Image - Dynamsoft Barcode Reader for Android User Guide
4+
description: This page explores how to read barcodes from an image with Dynamsoft Barcode Reader Android SDK.
5+
keywords: user guide, read from an image, Android, java, kotlin
6+
noTitleIndex: true
7+
needGenerateH3Content: true
8+
needAutoGenerateSidebar: true
9+
---
10+
11+
# How to Read Barcodes from an Image
12+
13+
> [!Note]
14+
> Reference the [DecodeFromAnImage sample](https://github.com/Dynamsoft/barcode-reader-mobile-samples/tree/main/android/FoundationalAPISamples/DecodeFromAnImage){:target="_blank"} for how to decode from the album.
15+
16+
The `capture` methods of `CaptureVisionRouter` class are designed to process a single image.
17+
18+
```java
19+
CapturedResult capture(String filePath, String templateName) {}
20+
CapturedResult capture(byte[] fileBytes, String templateName) {}
21+
CapturedResult capture(Bitmap bitmap, String templateName) {}
22+
CapturedResult capture(ImageData imageData, String templateName) {}
23+
```
24+
25+
## Supported Image Types
26+
27+
The following image types are supported:
28+
29+
1. Image with the file path.
30+
2. Image in memory (file bytes).
31+
3. `android.graphics.Bitmap`
32+
4. [com.dynamsoft.core.basic_structures.ImageData]({{ site.dcvb_android_api }}core/basic-structures/image-data.html)
33+
34+
> [!Note]
35+
> When decoding with a file path, you should input the full file path with the extension name. Supported extensions: ".bmp", ".jpg", ".png", ".gif" or one-page ".tiff".
36+
37+
## How to Specify Template Name
38+
39+
When using the capture method, a `templateName` is required. You can specify either a preset template or the name a custom template.
40+
41+
### Use a Preset Template
42+
43+
`EnumPresetTemplate.PT_READ_BARCODES_READ_RATE_FIRST` is suggested for the template name when processing an image.
44+
45+
```java
46+
CapturedResult capturedResult = mRouter.capture("Your-file-path",EnumPresetTemplate.PT_READ_BARCODES_READ_RATE_FIRST);
47+
```
48+
49+
### Use Customized Template
50+
51+
View [Parameters and Settings - Use a Customized Template](parameters-and-settings.md#use-a-customized-template) for details.
52+
53+
## Code Snippet
54+
55+
```java
56+
CapturedResult capturedResult = mRouter.capture("Your file path",EnumPresetTemplate.PT_READ_BARCODES_READ_RATE_FIRST);
57+
DecodedBarcodesResult decodedBarcodesResult = capturedResult.getDecodedBarcodesResult();
58+
BarcodeResultItem[] barcodeResultItems = decodedBarcodesResult.getItems();
59+
for(BarcodeResultItem barcodeResultItem: barcodeResultItems)
60+
{
61+
String barcodeText = barcodeResultItem.getText();
62+
String barcodeFormatString = barcodeResultItem.getFormatString();
63+
}
64+
```
65+
66+
- `CapturedResult`: The biggest set of image processing results. `DecodedBarcodesResult` is one of the subsets of the `CapturedResult`.
67+
- `DecodedBarcodesResult`: The set of barcode-type results. It contains an array of `BarcodeResultItem` and additional information.
68+
- `BarcodeResultItem`: Object that represents a single decoded barcode.
69+
70+
Read [Understand Barcode Decoding Results](../understand-decoded-barcodes-results.md) for more information.

0 commit comments

Comments
 (0)