Skip to content

Commit 90fd167

Browse files
update to 10.4.3001
1 parent 7d03dd8 commit 90fd167

File tree

235 files changed

+3495
-1473
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

235 files changed

+3495
-1473
lines changed

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@ These samples show you how to implement barcode scanning by calling a ready-to-u
2828

2929
| Sample Name | Description | Programming Language(s) |
3030
| ----------- | ----------- | ----------------------- |
31-
| `ScanSingleBarcode` | This sample shows how to the **BarcodeScanner** to scan and returns a singe barcode result. | Java(Android)/Kotlin/Objective-C/Swift |
31+
| `ScanSingleBarcode` | This sample shows how to use the **BarcodeScanner** to scan and returns a singe barcode result. | Java(Android)/Kotlin/Objective-C/Swift |
32+
| `ScanMultipleBarcode` | This sample shows how to use the **BarcodeScanner** to scan and returns multiple barcode results. | Java(Android)/Swift |
33+
| `ScenarioOrientedSamples` | This sample shows how to configure settings for several typical scenarios. | Java(Android)/Swift |
3234

3335
- API Reference
3436
- [Android](https://www.dynamsoft.com/barcode-reader/docs/mobile/programming/android/api-reference/barcode-scanner/)
@@ -41,10 +43,9 @@ High-level customization is available via the foundational APIs. These samples s
4143
| Sample Name | Description | Programming Language(s) |
4244
| ----------- | ----------- | ----------------------- |
4345
| `DecodeWithCameraEnhancer` | The simplest sample of video streaming barcode scanner using **DynamsoftCameraEnhancer** as the input source. | Java(Android)/Swift |
44-
| `DecodeWithCameraX` | The video streaming barcode scanner sample, but using **CameraX** as the input source. | Java(Android) |
45-
| `DecodeWithAVCaptureSession` | The video streaming barcode scanner sample, but using **AVCaptureSession** as the input source. | Swift |
46+
| `DecodeWithCameraX` | The video streaming barcode scanner sample, but using **CameraX** as the input source. | Java(Android)/Kotlin |
47+
| `DecodeWithAVCaptureSession` | The video streaming barcode scanner sample, but using **AVCaptureSession** as the input source. | Objective-C/Swift |
4648
| `DecodeFromAnImage` | The sample shows how to pick an image from the album for barcode decoding. | Java(Android)/Swift |
47-
| `DecodeMultipleBarcodes` | This sample shows how to efficiently decode multiple barcodes from the video stream. | Java(Android)/Swift |
4849
| `GeneralSettings` | Displays general barcode decoding settings and camera settings like barcode formats, expected barcode count and scan region settings. The default scan mode is continuous scanning. | Java(Android)/Swift |
4950
| `LocateAnItemWithBarcode` | Input an ID with barcode text and detect it from multiple barcodes under the screen. | Java(Android)/Swift |
5051
| `TinyBarcodeDecoding` | The sample to tell you how to process the tiny barcodes. Including zoom and focus control. | Java(Android)/Swift |

android/FoundationalAPISamples/DecodeMultipleBarcodes/.gitignore renamed to android/BarcodeScannerAPISamples/ScanMultipleBarcodes/.gitignore

File renamed without changes.
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
plugins {
2+
id 'com.android.application'
3+
}
4+
5+
android {
6+
namespace 'com.dynamsoft.scanmultiplebarcodes'
7+
compileSdk 34
8+
9+
defaultConfig {
10+
applicationId "com.dynamsoft.scanmultiplebarcodes"
11+
minSdk 21
12+
targetSdk 34
13+
versionCode 1
14+
versionName "1.0"
15+
16+
}
17+
18+
buildTypes {
19+
release {
20+
minifyEnabled false
21+
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
22+
}
23+
}
24+
compileOptions {
25+
sourceCompatibility JavaVersion.VERSION_11
26+
targetCompatibility JavaVersion.VERSION_11
27+
}
28+
}
29+
30+
dependencies {
31+
implementation 'com.dynamsoft:dynamsoftbarcodereaderbundle:10.4.3001'
32+
33+
implementation 'androidx.appcompat:appcompat:1.6.1'
34+
implementation 'com.google.android.material:material:1.9.0'
35+
}

android/FoundationalAPISamples/DecodeMultipleBarcodes/proguard-rules.pro renamed to android/BarcodeScannerAPISamples/ScanMultipleBarcodes/proguard-rules.pro

File renamed without changes.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
3+
4+
<application
5+
android:allowBackup="true"
6+
android:icon="@drawable/dbr_icon"
7+
android:label="@string/app_name"
8+
android:roundIcon="@mipmap/ic_launcher_round"
9+
android:supportsRtl="true"
10+
android:theme="@style/Theme.BarcodeScannerAPISamples">
11+
12+
<activity
13+
android:name=".MainActivity"
14+
android:exported="true">
15+
<intent-filter>
16+
<action android:name="android.intent.action.MAIN" />
17+
18+
<category android:name="android.intent.category.LAUNCHER" />
19+
</intent-filter>
20+
</activity>
21+
</application>
22+
23+
</manifest>
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
package com.dynamsoft.scanmultiplebarcodes;
2+
3+
import android.os.Bundle;
4+
import android.widget.TextView;
5+
6+
import com.dynamsoft.dbr.BarcodeResultItem;
7+
import com.dynamsoft.dbrbundle.ui.BarcodeScanResult;
8+
import com.dynamsoft.dbrbundle.ui.BarcodeScannerActivity;
9+
import com.dynamsoft.dbrbundle.ui.BarcodeScannerConfig;
10+
import com.dynamsoft.dbrbundle.ui.EnumScanningMode;
11+
12+
import androidx.activity.result.ActivityResultLauncher;
13+
import androidx.annotation.Nullable;
14+
import androidx.appcompat.app.AppCompatActivity;
15+
16+
/**
17+
* @author: dynamsoft
18+
* Time: 2024/9/29
19+
* Description:
20+
*/
21+
public class MainActivity extends AppCompatActivity {
22+
private ActivityResultLauncher<BarcodeScannerConfig> launcher;
23+
24+
@Override
25+
protected void onCreate(@Nullable Bundle savedInstanceState) {
26+
super.onCreate(savedInstanceState);
27+
setContentView(R.layout.activity_main);
28+
29+
TextView textView = findViewById(R.id.tv_result);
30+
31+
//optional
32+
BarcodeScannerConfig config = new BarcodeScannerConfig();
33+
config.setLicense("DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9");
34+
config.setTorchButtonVisible(true);
35+
config.setCloseButtonVisible(true);
36+
config.setScanLaserVisible(true);
37+
config.setScanningMode(EnumScanningMode.SM_MULTIPLE);
38+
//config.setScanRegion(new DSRect(0.15f, 0.25f, 0.85f, 0.65f, true));
39+
config.setAutoZoomEnabled(false);
40+
//optional
41+
42+
//must call
43+
launcher = registerForActivityResult(new BarcodeScannerActivity.ResultContract(), result -> {
44+
if (result.getResultStatus() == BarcodeScanResult.EnumResultStatus.RS_FINISHED && result.getBarcodes() != null) {
45+
StringBuilder content = new StringBuilder();
46+
content.append("Count: ").append(result.getBarcodes().length).append("\n");
47+
for (BarcodeResultItem barcode : result.getBarcodes()) {
48+
content.append("Result: format: ").append(barcode.getFormatString()).append("\n").append("content: ").append(barcode.getText()).append("\n\n");
49+
}
50+
textView.setText(content.toString());
51+
} else if(result.getResultStatus() == BarcodeScanResult.EnumResultStatus.RS_CANCELED ){
52+
textView.setText("Scan canceled.");
53+
}
54+
if (result.getErrorString() != null && !result.getErrorString().isEmpty()) {
55+
textView.setText(result.getErrorString());
56+
}
57+
});
58+
59+
findViewById(R.id.btn_navigate).setOnClickListener(v -> launcher.launch(config));
60+
}
61+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<vector xmlns:android="http://schemas.android.com/apk/res/android"
2+
xmlns:aapt="http://schemas.android.com/aapt"
3+
android:width="108dp"
4+
android:height="108dp"
5+
android:viewportWidth="108"
6+
android:viewportHeight="108">
7+
<path android:pathData="M31,63.928c0,0 6.4,-11 12.1,-13.1c7.2,-2.6 26,-1.4 26,-1.4l38.1,38.1L107,108.928l-32,-1L31,63.928z">
8+
<aapt:attr name="android:fillColor">
9+
<gradient
10+
android:endX="85.84757"
11+
android:endY="92.4963"
12+
android:startX="42.9492"
13+
android:startY="49.59793"
14+
android:type="linear">
15+
<item
16+
android:color="#44000000"
17+
android:offset="0.0" />
18+
<item
19+
android:color="#00000000"
20+
android:offset="1.0" />
21+
</gradient>
22+
</aapt:attr>
23+
</path>
24+
<path
25+
android:fillColor="#FFFFFF"
26+
android:fillType="nonZero"
27+
android:pathData="M65.3,45.828l3.8,-6.6c0.2,-0.4 0.1,-0.9 -0.3,-1.1c-0.4,-0.2 -0.9,-0.1 -1.1,0.3l-3.9,6.7c-6.3,-2.8 -13.4,-2.8 -19.7,0l-3.9,-6.7c-0.2,-0.4 -0.7,-0.5 -1.1,-0.3C38.8,38.328 38.7,38.828 38.9,39.228l3.8,6.6C36.2,49.428 31.7,56.028 31,63.928h46C76.3,56.028 71.8,49.428 65.3,45.828zM43.4,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2c-0.3,-0.7 -0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C45.3,56.528 44.5,57.328 43.4,57.328L43.4,57.328zM64.6,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2s-0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C66.5,56.528 65.6,57.328 64.6,57.328L64.6,57.328z"
28+
android:strokeWidth="1"
29+
android:strokeColor="#00000000" />
30+
</vector>

android/FoundationalAPISamples/DecodeMultipleBarcodes/src/main/res/drawable/dbr_icon.xml renamed to android/BarcodeScannerAPISamples/ScanMultipleBarcodes/src/main/res/drawable/dbr_icon.xml

File renamed without changes.
Lines changed: 170 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,170 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<vector xmlns:android="http://schemas.android.com/apk/res/android"
3+
android:width="108dp"
4+
android:height="108dp"
5+
android:viewportWidth="108"
6+
android:viewportHeight="108">
7+
<path
8+
android:fillColor="#3DDC84"
9+
android:pathData="M0,0h108v108h-108z" />
10+
<path
11+
android:fillColor="#00000000"
12+
android:pathData="M9,0L9,108"
13+
android:strokeWidth="0.8"
14+
android:strokeColor="#33FFFFFF" />
15+
<path
16+
android:fillColor="#00000000"
17+
android:pathData="M19,0L19,108"
18+
android:strokeWidth="0.8"
19+
android:strokeColor="#33FFFFFF" />
20+
<path
21+
android:fillColor="#00000000"
22+
android:pathData="M29,0L29,108"
23+
android:strokeWidth="0.8"
24+
android:strokeColor="#33FFFFFF" />
25+
<path
26+
android:fillColor="#00000000"
27+
android:pathData="M39,0L39,108"
28+
android:strokeWidth="0.8"
29+
android:strokeColor="#33FFFFFF" />
30+
<path
31+
android:fillColor="#00000000"
32+
android:pathData="M49,0L49,108"
33+
android:strokeWidth="0.8"
34+
android:strokeColor="#33FFFFFF" />
35+
<path
36+
android:fillColor="#00000000"
37+
android:pathData="M59,0L59,108"
38+
android:strokeWidth="0.8"
39+
android:strokeColor="#33FFFFFF" />
40+
<path
41+
android:fillColor="#00000000"
42+
android:pathData="M69,0L69,108"
43+
android:strokeWidth="0.8"
44+
android:strokeColor="#33FFFFFF" />
45+
<path
46+
android:fillColor="#00000000"
47+
android:pathData="M79,0L79,108"
48+
android:strokeWidth="0.8"
49+
android:strokeColor="#33FFFFFF" />
50+
<path
51+
android:fillColor="#00000000"
52+
android:pathData="M89,0L89,108"
53+
android:strokeWidth="0.8"
54+
android:strokeColor="#33FFFFFF" />
55+
<path
56+
android:fillColor="#00000000"
57+
android:pathData="M99,0L99,108"
58+
android:strokeWidth="0.8"
59+
android:strokeColor="#33FFFFFF" />
60+
<path
61+
android:fillColor="#00000000"
62+
android:pathData="M0,9L108,9"
63+
android:strokeWidth="0.8"
64+
android:strokeColor="#33FFFFFF" />
65+
<path
66+
android:fillColor="#00000000"
67+
android:pathData="M0,19L108,19"
68+
android:strokeWidth="0.8"
69+
android:strokeColor="#33FFFFFF" />
70+
<path
71+
android:fillColor="#00000000"
72+
android:pathData="M0,29L108,29"
73+
android:strokeWidth="0.8"
74+
android:strokeColor="#33FFFFFF" />
75+
<path
76+
android:fillColor="#00000000"
77+
android:pathData="M0,39L108,39"
78+
android:strokeWidth="0.8"
79+
android:strokeColor="#33FFFFFF" />
80+
<path
81+
android:fillColor="#00000000"
82+
android:pathData="M0,49L108,49"
83+
android:strokeWidth="0.8"
84+
android:strokeColor="#33FFFFFF" />
85+
<path
86+
android:fillColor="#00000000"
87+
android:pathData="M0,59L108,59"
88+
android:strokeWidth="0.8"
89+
android:strokeColor="#33FFFFFF" />
90+
<path
91+
android:fillColor="#00000000"
92+
android:pathData="M0,69L108,69"
93+
android:strokeWidth="0.8"
94+
android:strokeColor="#33FFFFFF" />
95+
<path
96+
android:fillColor="#00000000"
97+
android:pathData="M0,79L108,79"
98+
android:strokeWidth="0.8"
99+
android:strokeColor="#33FFFFFF" />
100+
<path
101+
android:fillColor="#00000000"
102+
android:pathData="M0,89L108,89"
103+
android:strokeWidth="0.8"
104+
android:strokeColor="#33FFFFFF" />
105+
<path
106+
android:fillColor="#00000000"
107+
android:pathData="M0,99L108,99"
108+
android:strokeWidth="0.8"
109+
android:strokeColor="#33FFFFFF" />
110+
<path
111+
android:fillColor="#00000000"
112+
android:pathData="M19,29L89,29"
113+
android:strokeWidth="0.8"
114+
android:strokeColor="#33FFFFFF" />
115+
<path
116+
android:fillColor="#00000000"
117+
android:pathData="M19,39L89,39"
118+
android:strokeWidth="0.8"
119+
android:strokeColor="#33FFFFFF" />
120+
<path
121+
android:fillColor="#00000000"
122+
android:pathData="M19,49L89,49"
123+
android:strokeWidth="0.8"
124+
android:strokeColor="#33FFFFFF" />
125+
<path
126+
android:fillColor="#00000000"
127+
android:pathData="M19,59L89,59"
128+
android:strokeWidth="0.8"
129+
android:strokeColor="#33FFFFFF" />
130+
<path
131+
android:fillColor="#00000000"
132+
android:pathData="M19,69L89,69"
133+
android:strokeWidth="0.8"
134+
android:strokeColor="#33FFFFFF" />
135+
<path
136+
android:fillColor="#00000000"
137+
android:pathData="M19,79L89,79"
138+
android:strokeWidth="0.8"
139+
android:strokeColor="#33FFFFFF" />
140+
<path
141+
android:fillColor="#00000000"
142+
android:pathData="M29,19L29,89"
143+
android:strokeWidth="0.8"
144+
android:strokeColor="#33FFFFFF" />
145+
<path
146+
android:fillColor="#00000000"
147+
android:pathData="M39,19L39,89"
148+
android:strokeWidth="0.8"
149+
android:strokeColor="#33FFFFFF" />
150+
<path
151+
android:fillColor="#00000000"
152+
android:pathData="M49,19L49,89"
153+
android:strokeWidth="0.8"
154+
android:strokeColor="#33FFFFFF" />
155+
<path
156+
android:fillColor="#00000000"
157+
android:pathData="M59,19L59,89"
158+
android:strokeWidth="0.8"
159+
android:strokeColor="#33FFFFFF" />
160+
<path
161+
android:fillColor="#00000000"
162+
android:pathData="M69,19L69,89"
163+
android:strokeWidth="0.8"
164+
android:strokeColor="#33FFFFFF" />
165+
<path
166+
android:fillColor="#00000000"
167+
android:pathData="M79,19L79,89"
168+
android:strokeWidth="0.8"
169+
android:strokeColor="#33FFFFFF" />
170+
</vector>
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
3+
android:layout_width="match_parent"
4+
android:layout_height="match_parent"
5+
android:gravity="center"
6+
android:orientation="vertical">
7+
8+
9+
<Button
10+
android:id="@+id/btn_navigate"
11+
android:layout_width="wrap_content"
12+
android:layout_height="wrap_content"
13+
android:text="Start Scanning" />
14+
15+
<ScrollView
16+
android:layout_marginHorizontal="16dp"
17+
android:layout_width="match_parent"
18+
android:layout_height="wrap_content">
19+
20+
<TextView
21+
android:id="@+id/tv_result"
22+
android:layout_width="wrap_content"
23+
android:layout_height="wrap_content"
24+
android:text=""
25+
android:textSize="20sp" />
26+
</ScrollView>
27+
28+
</LinearLayout>

0 commit comments

Comments
 (0)