From 8fcee61cd75b1c405d4a76831e52690b655a5e9d Mon Sep 17 00:00:00 2001 From: VincentKobz Date: Fri, 19 Apr 2024 16:55:20 +0200 Subject: [PATCH] update: Documentation to support the camera SDK refactor --- docs/api/camera.md | 8 +++++--- docs/api/scanner_activity.md | 25 ++++++++++++++++--------- docs/dependencies.md | 9 +++++++-- docs/quickstart.md | 15 ++++++++++++--- 4 files changed, 40 insertions(+), 17 deletions(-) diff --git a/docs/api/camera.md b/docs/api/camera.md index 0a55de9b..147ce496 100644 --- a/docs/api/camera.md +++ b/docs/api/camera.md @@ -1,8 +1,10 @@ # The camera scanner -**enioka Scan** can still be used to manage barcodes scanned using the Android camera. For that, it -exposes the `CameraBarcodeScanView` and a series of helper classes to handle compatibility with both -Camera 1 and Camera 2 hardware APIs. +**enioka Scan** can still be used to manage barcodes scanned using the Android camera, through +`com.enioka.scanner.sdk.camera`, (check +[library dependencies and compatibility matrix](dependencies.md)). For that, it exposes the +`CameraBarcodeScanView` and a series of helper classes to handle compatiblity with both Camera 1 +and Camera 2 hardware APIs. This page regroups all information needed to control this special scanner at a deeper level. diff --git a/docs/api/scanner_activity.md b/docs/api/scanner_activity.md index c9e134ae..cb713b3a 100644 --- a/docs/api/scanner_activity.md +++ b/docs/api/scanner_activity.md @@ -51,14 +51,16 @@ service. **This does not affect scanner search options**. The layout used by the activity when using regular scanner devices. May be replaced with your own. ::: -:::{cpp:var} int layoutIdCamera = R.layout.activity_main_alt +:::{cpp:var} Integer layoutIdCamera = null The layout used by the activity when using the camera as a scanner. May be replaced with your own. +If the camera SDK is included, it will be defined to :::{cpp:var}R.layout.activity_main_alt ::: -:::{cpp:var} int cameraViewId = R.id.camera_scan_view +:::{cpp:var} Integer cameraViewId = null -The ID of the [`CameraBarcodeScanView`](camera.md#the-camerabarcodescanview-class) inside the +If the camera SDK is included, it will be defined to :::{cpp:var}R.id.camera_scan_view +It is the ID of the [`CameraBarcodeScanView`](camera.md#the-camerabarcodescanview-class) inside the `layoutIdCamera` layout. ::: @@ -72,14 +74,17 @@ The ID of the optional ImageButton on which to press to manually switch to camer The ID of the optional ImageButton on which to press to toggle the flashlight/illumination. ::: -:::{cpp:var} int scannerModeToggleViewId = R.id.scanner_switch_zxing +:::{cpp:var} Integer scannerModeToggleViewId = null -The ID of the optional ImageButton on which to press to toggle the zxing/zbar camera scan library. +If the camera SDK is included, it will be defined to :::{cpp:var}R.id.scanner_switch_zxing. +It is the ID of the optional ImageButton on which to press to toggle the zxing/zbar camera scan +library. ::: -:::{cpp:var} int scannerModeTogglePauseId = R.id.scanner_switch_pause +:::{cpp:var} Integer scannerModeTogglePauseId = -The ID of the optional toggle button on which to press to pause/unpause the scanner. +If the camera SDK is included, it will be defined to :::{cpp:var}R.id.scanner_switch_pause. +It is the ID of the optional toggle button on which to press to pause/unpause the scanner. ::: :::{cpp:var} int keyboardOpenViewId = R.id.scanner_bt_keyboard @@ -111,9 +116,11 @@ replaced. Initialized by the `onStart()` and `onResume()` methods. ::: -:::{cpp:var} CameraBarcodeScanViewScanner cameraScanner; +:::{cpp:var} CameraScanner cameraScannerProvider = null; + +The optional instance of the camera scanner provider, is defined if the camera SDK is included. +Can be used to access some methods of `CameraBarcodeScanViewScanner`. Should not be replaced. -The instance of the camera scanner, can be used to access camera methods but should not be replaced. `CameraBarcodeScanViewScanner` is a simple provider-less implementation of the [`Scanner` interface](scanner.md#the-scanner-interface). diff --git a/docs/dependencies.md b/docs/dependencies.md index 4780262a..4df30fab 100644 --- a/docs/dependencies.md +++ b/docs/dependencies.md @@ -20,7 +20,12 @@ Each artefact can be imported to your project as `com.enioka.scanner:: ### `scanner` Core components of the library, **required** for it to work. It includes the scanner APIs, default -scanning activity and service, and camera-as-a-scanner functionality. +scanning activity and service. + +### `scanner-camera` + +Includes the `CAMERA_SCANNER` provider. It includes camera-as-a-scanner functionality, and +default camera layout for scanner activity. ### `provider-cs-athesi-e5l` @@ -152,7 +157,7 @@ devices. | Artefact | Provider name | Supported devices | Tested devices | Device type | External requirements | Device compatible if | |------------------------------------|----------------------------------|-----------------------------------------------------|------------------------------------|---------------|----------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------| -| `scanner` | `CAMERA_SCANNER` (no provider) | Any device with a camera | Smartphones, integrated devices... | Camera | | Device has a camera | +| `scanner-camera` | `CAMERA_SCANNER` (no provider) | Any device with a camera | Smartphones, integrated devices... | Camera | | Device has a camera | | `provider-cs-athesi-e5l` | `AthesiE5LProvider` | Athesi E5L | Athesi E5L | Integrated | | Device name is strictly `RD50TE` | | `provider-cs-athesi-spa43` | `AthesiHHTProvider` | Athesi SPA43 | Athesi SPA43 | Integrated | | Device name is strictly `SPA43LTE` | | `provider-cs-bluebird` | `BluebirdProvider` | Bluebird integrated scanners | Bluebird EF500 | Integrated | Bluebird service (should be preinstalled on device) | Intent `kr.co.bluebird.android.bbapi.action.BARCODE_OPEN` has a listener | diff --git a/docs/quickstart.md b/docs/quickstart.md index af521516..93ea25ed 100644 --- a/docs/quickstart.md +++ b/docs/quickstart.md @@ -19,9 +19,9 @@ dependencies { } ``` -To use the smartphone's camera as a scanner, this single dependency is enough. To use others devices, -dependencies are required, you can check the -[library dependencies and compatibility matrix](dependencies.md) for a detailed overview. +To use others devices or the smartphone's camera as a scanner, dependencies are required, +you can check the [library dependencies and compatibility matrix](dependencies.md) +for a detailed overview. ## Using the library @@ -48,6 +48,9 @@ This creates an activity with a very simple layout, which displays status messag as well as scanning results and some utility buttons: triggers for the scanner, a toggle for illumination, and a beep trigger. +If the camera scanner SDK is included (`com.enioka.scanner.sdk.camera`), the default camera layout +and view will also be available inside the activity. + To use your own layouts with this activity, you can follow [this guide](guides/custom_layout.md). Finally, note that inside the activity code there are a few hooks that can be overloaded - these are @@ -114,6 +117,12 @@ help converting search parameters to and from those intent extras. ## Using the camera +:::{warning} + +* `com.enioka.scanner.sdk.camera` dependencies are required to use the camera scanner, check + [library dependencies and compatibility matrix](dependencies.md). + ::: + When there is no laser scanner available, or when a button is clicked, the `ScannerCompatActivity` activity will fallback to using the device camera (if any) to scan barcodes. This leverages two different barcode scanning libraries, ZBar and ZXing in recent versions. It is compatible both with