Skip to content

Commit

Permalink
update: Documentation to support the camera SDK refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
VincentKobz committed Apr 23, 2024
1 parent 51e4865 commit 8fcee61
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 17 deletions.
8 changes: 5 additions & 3 deletions docs/api/camera.md
Original file line number Diff line number Diff line change
@@ -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.

Expand Down
25 changes: 16 additions & 9 deletions docs/api/scanner_activity.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
:::

Expand All @@ -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
Expand Down Expand Up @@ -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).

Expand Down
9 changes: 7 additions & 2 deletions docs/dependencies.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,12 @@ Each artefact can be imported to your project as `com.enioka.scanner:<artefact>:
### `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`

Expand Down Expand Up @@ -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 |
Expand Down
15 changes: 12 additions & 3 deletions docs/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 8fcee61

Please sign in to comment.