You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: programming/android/user-guide.md
+113-4Lines changed: 113 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -404,10 +404,119 @@ Now that the code has been written and the project complete, it's time to run th
404
404
405
405
Now that your `BarcodeScanner` project is up and running you should be able to see a clean and simplified UI that contains all the necessary UI elements that are needed to make the barcode scanning process as easy and intuitive for the user as it can be.
406
406
407
-
## Next Steps
407
+
## Key APIs
408
+
409
+
### BarcodeScannerConfig
410
+
411
+
Configurations for `BarcodeScanner` component.
412
+
413
+
| Method | Description |
414
+
| ------ | ----------- |
415
+
|`setLicense`| Sets the license key for the Barcode Reader. |
416
+
|`getLicense`| Returns the license key string. |
417
+
|`setScanningMode`| Sets the scanning mode. |
418
+
|`getScanningMode`| Returns the scanning mode. |
419
+
|`setTemplateFile`| Sets the template with a file path or a JSON string. |
420
+
|`getTemplateFile`| Returns the template with a file path or a JSON string. |
421
+
|`setBarcodeFormats`| Sets the barcode format(s) to read. |
422
+
|`getBarcodeFormats`| Returns the barcode format(s) that the library will accept. |
423
+
|`setScanRegion`| Sets a scan region where only the barcodes located in the scan region can be decoded. |
424
+
|`getScanRegion`| Returns the scan region. |
425
+
|`setTorchButtonVisible`| Sets whether to display the torch button when scanning or not. |
426
+
|`isTorchButtonVisible`| Returns whether the button is visible. |
427
+
|`setBeepEnabled`| Sets whether to trigger a beep sound when a barcode is detected. |
428
+
|`isBeepEnabled`| Returns whether the beep sound is enabled. |
429
+
|`setVibrateEnabled`| Sets whether to trigger a vibration when a barcode is detected. |
430
+
|`isVibrateEnabled`| Returns whether the vibration is enabled. |
431
+
|`setScanLaserVisible`| Sets whether to display a scan laser when scanning. |
432
+
|`isScanLaserVisible`| Returns whether the scan laser is visible. |
433
+
|`setAutoZoomEnabled`| Sets whether to enable the auto-zoom feature when scanning. |
434
+
|`isAutoZoomEnabled`| Returns whether the auto-zoom feature is enabled. |
435
+
|`setCloseButtonVisible`| Sets whether to display a button that can close the scanner page. |
436
+
|`isCloseButtonVisible`| Returns whether the close button is visible. |
437
+
|`setMaxConsecutiveStableFramesToExit`| Sets how long the library will keep scanning when there is no more barcodes to decode. |
438
+
|`getMaxConsecutiveStableFramesToExit`| Returns the maximum number of consecutive stable frames to exit. |
439
+
|`setExpectedBarcodesCount`| Sets the expected number of barcodes. The multiple barcodes scanning will be stopped when the `expectedBarcodesCount` is reached. |
440
+
|`getExpectedBarcodesCount`| Returns the expected number of barcodes. |
441
+
|`setCameraToggleButtonVisible`| Sets whether to display the camera toggle button. |
442
+
|`isCameraToggleButtonVisible`| Returns whether the camera toggle button is visible. |
443
+
|`setZoomFactor`| Sets the zoom factor. |
444
+
|`getZoomFactor`| Returns the zoom factor. |
445
+
|`setResolution`| Sets the resolution. |
446
+
|`getResolution`| Returns the resolution. |
408
447
409
-
For more configurations of the BarcodeScanner, please refer to the [Configure Barcode Scanner](user-guide/configure-barcode-scanner.md) section.
Result object produced by the `BarcodeScanner` component.
489
+
490
+
| Method | Description |
491
+
| ------ | ----------- |
492
+
|`getBarcodes`| Returns an array of [`BarcodeResultItem`]({{ site.dbr_android_api }}barcode-result-item.html), which represents a single barocde result. |
493
+
|`getResultStatus`| Returns the status of the `BarcodeScanResult`, of type [`EnumResultStatus`](#enumresultstatus). |
494
+
|`getErrorCode`| Returns the error code should something go wrong during the barcode recognition process. |
495
+
|`getErrorString`| Returns the error message associated with the error code should something go wrong during the barcode recognition process. |
496
+
497
+
```java
498
+
publicBarcodeResultItem[] getBarcodes() {}
499
+
@EnumResultStatus
500
+
publicint getResultStatus() {}
501
+
publicint getErrorCode() {}
502
+
publicString getErrorString() {}
503
+
```
504
+
505
+
### EnumScanningMode
506
+
507
+
Enumeration for specifying the scanning mode.
508
+
509
+
| Member | Description |
510
+
| ------ | ----------- |
511
+
|`SM_SINGLE`| The scan mode for scanning single barcode. |
512
+
|`SM_MULTIPLE`| The scan mode for scanning multiple barcodes. |
513
+
514
+
### EnumResultStatus
410
515
411
-
If you would like to work with the original framework and create your own customized UI, please refer to the [Build Your APP with Foundational APIs](foundational-guide.md).
516
+
Enumeration that represents the result status of the `BarcodeScanResult`.
412
517
413
-
If you have any questions in regards to the usage of the new specialized SDK, do not hesitate to get in touch with the [Dynamsoft Support Team](https://www.dynamsoft.com/contact/).
518
+
| Member | Description |
519
+
| ------ | ----------- |
520
+
|`RS_FINISHED`| The barcode scanning is finished. You can get at least one result from the `BarcodeScanResult`. |
521
+
|`RS_CANCELED`| The barcode scanning activity is closed before the process is finished. No results are available. |
522
+
|`RS_EXCEPTION`| Failed to start barcode scanning or an error occurs when scanning the barcodes. No results are available. |
0 commit comments