Skip to content

Commit 5f233ca

Browse files
Updating android side list
1 parent 4274f6c commit 5f233ca

20 files changed

Lines changed: 1129 additions & 214 deletions

_includes/sidelist-programming/programming-android.html

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,21 @@
2222
<li lang="android"><a href="{{ site.android }}user-guide/capabilities/read-from-an-image.html" class="otherLinkColour">Read from Image</a></li>
2323
</ul>
2424
</li>
25-
<li lang="android"><a href="{{ site.features }}get-detailed-info.html?lang=android" class="otherLinkColour">Working with Results</a>
25+
<li lang="android"><a class="otherLinkColour">Working with Results</a>
2626
<ul lang="android">
2727
<li lang="android"><a href="{{ site.features }}get-detailed-info.html?lang=android" class="otherLinkColour">Get detailed barcode information</a></li>
2828
<li lang="android"><a href="{{ site.features }}filter-and-sort.html?lang=android" class="otherLinkColour">Filter and sort decoding results</a></li>
2929
</ul>
3030
</li>
31-
<li lang="android"><a href="{{ site.features }}get-detailed-info.html?lang=android" class="otherLinkColour">Control the Scanning Process</a>
31+
<li lang="android"><a class="otherLinkColour">Control the Scanning Process</a>
3232
<ul lang="android">
33-
<li lang="android"><a href="{{ site.android }}user-guide/capabilities/config-barcode-format.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>
33+
<li lang="android"><a href="{{ site.android }}user-guide/capabilities/init-customized-template.html" class="otherLinkColour">Initialize Customized Template</a></li>
34+
<li lang="android"><a href="{{ site.android }}user-guide/capabilities/configure-simplified-settings.html" class="otherLinkColour">Configure Simplified Settings</a></li>
35+
<li lang="android"><a href="{{ site.android }}user-guide/capabilities/barcode-formats.html" class="otherLinkColour">Configure Barcode Format</a></li>
36+
<li lang="android"><a href="{{ site.android }}user-guide/capabilities/feedback.html" class="otherLinkColour">Add Scan Feedback</a></li>
37+
<li lang="android"><a href="{{ site.android }}user-guide/capabilities/read-specific-area.html" class="otherLinkColour">Read a specific area/region</a></li>
38+
<li lang="android"><a href="{{ site.android }}user-guide/capabilities/single-multiple.html" class="otherLinkColour">Switch Single & Multiple</a></li>
39+
<li lang="android"><a href="{{ site.android }}user-guide/capabilities/zoom-control.html" class="otherLinkColour">Zoom Control</a></li>
3540
</ul>
3641
</li>
3742
<li lang="android"><a class="otherLinkColour">Decode Challenging Barcodes</a>

programming/android/user-guide/capabilities/config-barcode-format.md renamed to programming/android/user-guide/capabilities/barcode-formats.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
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.
3+
title: Configure Barcode Formats - Dynamsoft Barcode Reader Android
4+
description: Learn how to configure barcode formats in the Dynamsoft Barcode Reader Android SDK.
55
keywords: barcode formats, Android, java, kotlin
66
noTitleIndex: true
77
needGenerateH3Content: true
@@ -10,17 +10,17 @@ needAutoGenerateSidebar: true
1010

1111
# Configure Barcode Formats
1212

13-
Here are 2 ways for configuring barcode formats:
13+
There are two ways to configure barcode formats:
1414

1515
- Configure formats in code.
1616
- Configure formats together with other settings in the template.
1717

1818
## Configure Formats in Your Code
1919

20-
You specify barcode formats using a combined value of [`EnumBarcodeFormat`]({{ site.dbr_android_api }}enum/barcode-format.html).
20+
Specify barcode formats using a combined value of [`EnumBarcodeFormat`]({{ site.dbr_android_api }}enum/barcode-format.html).
2121

2222
- 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)
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`, and `BF_GS1_COMPOSITE`).
2424
- Use `EnumBarcodeFormat.BF_ALL` to enable all supported formats.
2525
- Use group values like `EnumBarcodeFormat.BF_ONED` when appropriate.
2626

@@ -44,22 +44,22 @@ Example:
4444

4545
```java
4646
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);
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);
5252
} catch (CaptureVisionRouterException e) {
53-
throw new RuntimeException(e);
53+
throw new RuntimeException(e);
5454
}
5555
```
5656

5757
> [!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).
58+
> If you are already using a customized template, you usually do not need to specify formats again in code. See [Use a Customized Template](parameters-and-templates.md#use-a-customized-template) for details.
5959
6060
## Configure Formats in a Template
6161

62-
Barcode formats are specified in `BarcodeFormatIds` of `BarcodeReaderTaskSettingOptions`. For example:
62+
Barcode formats are specified in `BarcodeFormatIds` under `BarcodeReaderTaskSettingOptions`. For example:
6363

6464
```json
6565
{
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
---
2+
layout: default-layout
3+
title: Configuring Simplified Settings - Dynamsoft Barcode Reader Android
4+
description: Learn how to configure simplified settings in the Dynamsoft Barcode Reader Android SDK.
5+
keywords: simplified settings, Android, java, kotlin
6+
noTitleIndex: true
7+
needGenerateH3Content: true
8+
needAutoGenerateSidebar: true
9+
---
10+
11+
# How to Configure Simplified Settings
12+
13+
> [!Important]
14+
> Features on this page are only available for the **Foundational APIs**.
15+
16+
This page explores how to configure basic image processing settings with `SimplifiedCaptureVisionSettings`. The following APIs will be used:
17+
18+
1. `getSimplifiedSettings`: Get the settings of the specified `template`.
19+
2. `updateSettings`: Update the settings to the specified `template`.
20+
21+
<div class="sample-code-prefix"></div>
22+
>- Java
23+
>- Kotlin
24+
>
25+
>1.
26+
```java
27+
CaptureVisionRouter mRouter;
28+
mRouter = new CaptureVisionRouter();
29+
try {
30+
// Obtain current runtime settings.
31+
SimplifiedCaptureVisionSettings simplifiedCaptureVisionSettings = mRouter.getSimplifiedSettings(EnumPresetTemplate.PT_READ_BARCODES);
32+
simplifiedCaptureVisionSettings.minImageCaptureInterval = 200;
33+
simplifiedCaptureVisionSettings.timeout = 200;
34+
SimplifiedBarcodeReaderSettings simplifiedBarcodeReaderSettings = simplifiedCaptureVisionSettings.barcodeSettings;
35+
simplifiedBarcodeReaderSettings.barcodeFormatIds = EnumBarcodeFormat.BF_QR_CODE | EnumBarcodeFormat.BF_DATAMATRIX;
36+
simplifiedBarcodeReaderSettings.expectedBarcodesCount = 1;
37+
// Update settings. Here you must specify the same template name you used when getting the settings.
38+
mRouter.updateSettings(EnumPresetTemplate.PT_READ_BARCODES, simplifiedCaptureVisionSettings);
39+
} catch (CaptureVisionRouterException e) {
40+
throw new RuntimeException(e);
41+
}
42+
```
43+
2.
44+
```kotlin
45+
val mRouter: CaptureVisionRouter? = CaptureVisionRouter()
46+
try {
47+
// Obtain current runtime settings.
48+
val simplifiedCaptureVisionSettings = mRouter?.getSimplifiedSettings(EnumPresetTemplate.PT_READ_BARCODES)
49+
simplifiedCaptureVisionSettings?.minImageCaptureInterval = 200
50+
simplifiedCaptureVisionSettings?.timeout = 200
51+
val simplifiedBarcodeReaderSettings = simplifiedCaptureVisionSettings?.barcodeSettings
52+
simplifiedBarcodeReaderSettings!!.barcodeFormatIds = EnumBarcodeFormat.BF_QR_CODE or EnumBarcodeFormat.BF_DATAMATRIX
53+
simplifiedBarcodeReaderSettings.expectedBarcodesCount = 1
54+
// Update settings. Here you must specify the same template name you used when getting the settings.
55+
mRouter?.updateSettings(EnumPresetTemplate.PT_READ_BARCODES, simplifiedCaptureVisionSettings)
56+
} catch (e: CaptureVisionRouterException) {
57+
throw RuntimeException(e)
58+
}
59+
```
60+
61+
> [!Note]
62+
> To use the settings you have configured, you must specify the same template name when triggering the `startCapturing` or `capture` methods.
Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
---
2+
layout: default-layout
3+
title: Customize the UI of BarcodeScanner - Dynamsoft Barcode Reader for Android
4+
description: Learn how to customize the BarcodeScanner UI on Android.
5+
keywords: BarcodeScanner, scanner, Android, scan region, torch button, close button, scan laser
6+
needAutoGenerateSidebar: true
7+
needGenerateH3Content: true
8+
noTitleIndex: true
9+
---
10+
11+
# Configure the UI Elements
12+
13+
| Available UI Elements |
14+
| ------------------- |
15+
| Scan region |
16+
| Scan Laser |
17+
| Torch button |
18+
| Camera toggle button |
19+
| Close button (BarcodeScanner API only) |
20+
21+
BarcodeScanner provides a set of UI elements that you can easily customize.
22+
23+
<div align="center">
24+
<p><img src="../../assets/barcode-scanner-ui.png" width="70%" alt="barcode-scanner"></p>
25+
<p>Barcode Scanner UI Components</p>
26+
</div>
27+
28+
- Close button: Stops barcode scanning and returns to the previous activity.
29+
- Scan region: Sets a region of interest so the algorithm focuses only on that area. This can significantly improve processing speed. For special barcode types such as DotCode, the scan region can also improve the read rate.
30+
- Scan laser: A line that moves up and down. Its movement is limited to the scan region.
31+
- Torch button: A clickable button that turns the torch on or off.
32+
33+
## Scan Region & Scan Laser
34+
35+
### Configure with BarcodeScanner APIs
36+
37+
<div class="sample-code-prefix"></div>
38+
>- Java
39+
>- Kotlin
40+
>
41+
>1.
42+
```java
43+
BarcodeScannerConfig config = new BarcodeScannerConfig();
44+
// Margin left 15%, margin top 30%, margin right 85%, margin bottom 70%
45+
config.setScanRegion(new DSRect(0.15f, 0.25f, 0.85f, 0.65f, true));
46+
config.setScanLaserVisible(true);
47+
```
48+
2.
49+
```kotlin
50+
val config = BarcodeScannerConfig().apply {
51+
// Margin left 15%, margin top 30%, margin right 85%, margin bottom 70%
52+
scanRegion = DSRect(0.15f, 0.3f, 0.85f, 0.7f, true)
53+
scanLaserVisible = true
54+
}
55+
```
56+
57+
**Related APIs**
58+
59+
- [`BarcodeScannerConfig`]({{ site.dbr_android_api }}barcode-scanner/barcode-scanner-config.html)
60+
- [`setScanRegion`]({{ site.dbr_android_api }}barcode-scanner/barcode-scanner-config.html#setscanregion)
61+
- [`setScanLaserVisible`]({{ site.dbr_android_api }}barcode-scanner/barcode-scanner-config.html#setscanlaservisible)
62+
63+
### Configure with Foundational APIs
64+
65+
<div class="sample-code-prefix"></div>
66+
>- Java
67+
>- Kotlin
68+
>
69+
>1.
70+
```java
71+
CameraView cameraView = findViewById(R.id.camera_view);
72+
CameraEnhancer mCamera = new CameraEnhancer(cameraView, this);
73+
try {
74+
mCamera.setScanRegion(new DSRect(0.15f, 0.25f, 0.85f, 0.65f, true));
75+
} catch (CameraEnhancerException e) {
76+
throw new RuntimeException(e);
77+
}
78+
cameraView.setScanLaserVisible(true);
79+
```
80+
2.
81+
```kotlin
82+
val cameraView = findViewById<CameraView>(R.id.camera_view)
83+
val mCamera = CameraEnhancer(this)
84+
mCamera.scanRegion = DSRect(0.15f, 0.25f, 0.85f, 0.65f, true)
85+
cameraView.isScanLaserVisible = true
86+
```
87+
88+
**Related APIs**
89+
90+
- [`CameraEnhancer`]({{ site.dbr_android_api }}camera-enhancer/camera-enhancer.html)
91+
- [`setScanRegion`]({{ site.dbr_android_api }}camera-enhancer/camera-enhancer.html#setscanregion)
92+
- [`CameraView`]({{ site.dce_android }}auxiliary-api/dcecameraview.html)
93+
- [`setScanLaserVisible`]({{ site.dce_android }}auxiliary-api/dcecameraview.html#setscanlaservisible)
94+
95+
## Buttons
96+
97+
### Add Buttons with BarcodeScanner APIs
98+
99+
<div class="sample-code-prefix"></div>
100+
>- Java
101+
>- Kotlin
102+
>
103+
>1.
104+
```java
105+
BarcodeScannerConfig config = new BarcodeScannerConfig();
106+
config.setTorchButtonVisible(true);
107+
config.setCloseButtonVisible(true);
108+
config.setCameraToggleButtonVisible(true);
109+
```
110+
2.
111+
```kotlin
112+
val config = BarcodeScannerConfig().apply {
113+
torchButtonVisible = true
114+
closeButtonVisible = true
115+
cameraToggleButtonVisible = true
116+
}
117+
```
118+
119+
**Related APIs**
120+
121+
- [`BarcodeScannerConfig`]({{ site.dbr_android_api }}barcode-scanner/barcode-scanner-config.html)
122+
- [setTorchButtonVisible]({{ site.dbr_android_api }}barcode-scanner/barcode-scanner-config.html#settorchbuttonvisible)
123+
- [setCloseButtonVisible]({{ site.dbr_android_api }}barcode-scanner/barcode-scanner-config.html#setclosebuttonvisible)
124+
- [setCameraToggleButtonVisible]({{ site.dbr_android_api }}barcode-scanner/barcode-scanner-config.html#setcameratogglebuttonvisible)
125+
126+
### Add Buttons with Foundational APIs
127+
128+
<div class="sample-code-prefix"></div>
129+
>- Java
130+
>- Kotlin
131+
>
132+
>1.
133+
```java
134+
CameraView cameraView = findViewById(R.id.camera_view);
135+
cameraView.setTorchButtonVisible(true);
136+
cameraView.setCameraToggleButtonVisible(true);
137+
```
138+
2.
139+
```kotlin
140+
val cameraView = findViewById<CameraView>(R.id.camera_view)
141+
cameraView.torchButtonVisible = true
142+
cameraView.cameraToggleButtonVisible = true
143+
```
144+
145+
**Related APIs**
146+
147+
- [`CameraView`]({{ site.dce_android }}auxiliary-api/dcecameraview.html)
148+
- [setTorchButtonVisible]({{ site.dce_android }}auxiliary-api/dcecameraview.html#settorchbuttonvisible)
149+
- [setCameraToggleButtonVisible]({{ site.dce_android }}auxiliary-api/dcecameraview.html#setcameratogglebuttonvisible)
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
---
2+
layout: default-layout
3+
title: Add Scan Feedback for BarcodeScanner - Dynamsoft Barcode Reader for Android
4+
description: Learn how to enable scan feedback for BarcodeScanner on Android, including beep and vibration.
5+
keywords: BarcodeScanner, scanner, Android, feedback, beep, vibration
6+
needAutoGenerateSidebar: true
7+
needGenerateH3Content: true
8+
noTitleIndex: true
9+
---
10+
11+
# Add Scan Feedback
12+
13+
Trigger a beep sound or vibration when a barcode is scanned successfully.
14+
15+
### Use BarcodeScanner APIs
16+
17+
<div class="sample-code-prefix"></div>
18+
>- Java
19+
>- Kotlin
20+
>
21+
>1.
22+
```java
23+
BarcodeScannerConfig config = new BarcodeScannerConfig();
24+
config.setBeepEnabled(true);
25+
config.setVibrateEnabled(true);
26+
```
27+
2.
28+
```kotlin
29+
val config = BarcodeScannerConfig().apply {
30+
isVibrateEnabled = true
31+
isBeepEnabled = true
32+
}
33+
```
34+
35+
**Related API**
36+
37+
- [`isVibrateEnabled`]({{ site.dbr_android_api }}barcode-scanner/barcode-scanner-config.html#isvibrateenabled)
38+
- [`isBeepEnabled`]({{ site.dbr_android_api }}barcode-scanner/barcode-scanner-config.html#isbeepenabled)
39+
40+
### Use Foundational APIs
41+
42+
<div class="sample-code-prefix"></div>
43+
>- Java
44+
>- Kotlin
45+
>
46+
>1.
47+
```java
48+
Feedback.beep();
49+
Feedback.vibrate();
50+
```
51+
2.
52+
```kotlin
53+
Feedback.beep()
54+
Feedback.vibrate()
55+
```
56+
57+
**Related API**
58+
59+
- [`Feedback`]({{ site.dce_android }}auxiliary-api/dcefeedback.html)

0 commit comments

Comments
 (0)