| class info |
| com.huawei.hms.ml.scan.HmsScanAnalyzer |
| Detects barcodes using various methods for barcodes such as Code 128, Code 39, and Code 93. |
| Constructor name |
| HmsScanAnalyzer(android.content.Context context) Constructs HmsScanAnalyzer. |
| Return type | Method name |
| boolean | isAvailable() |
| android.util.SparseArray< HmsScan> | analyseFrame(MLFrame frame) |
| void | destory() throws IOException |
| com.huawei.hmf.tasks.Task<java.util.list> | analyzInAsyn(MLFrame frame) |
| Method |
| public HmsScanAnalyzer (android.content.Context context) |
| Constructs HmsScanAnalyzer. |
Parameters
| Parameter name | Parameter desc |
| context | Execution context. |
| Method |
| public boolean isAvailable() |
| Checks whether the barcode scanning function is normal. |
Return
| Type | desc |
| boolean | The value is true or false. true: The barcode scanning function is running properly. false: The barcode scanning function is not running properly. |
| Method |
| public android.util.SparseArray< HmsScan> analyseFrame(MLFrame frame) |
| Scans barcodes synchronously in MultiProcessor mode and provides the multi-barcode detection capability. |
Parameters
| Parameter name | Parameter desc |
| frame | Data collected by the camera, which is generated by MLFrame. |
Return
| Type | desc |
| android.util.SparseArray< HmsScan> | Basic class HmsScan instance list. The HmsScan basic class contains the detection result information. For details, see HmsScan. |
| Method |
| public void destory() throws IOException |
| Closes detected resources. |
Return
| Type | desc |
| void |
Throws
| Exception name | Exception desc |
| IOException | I/O error for closing resources. |
| Method |
| public com.huawei.hmf.tasks.Task< java.util.List< HmsScan>> analyzInAsyn(MLFrame frame) |
Scans barcodes asynchronously in MultiProcessor mode and provides the multi-barcode detection capability. |
Parameters
| Parameter name | Parameter desc |
| frame | Data collected by the camera, which is generated by MLFrame. |
Return
| Type | desc |
| com.huawei.hmf.tasks.Task<java.util.List<HmsScan>> | Asynchronous task instance, which contains the barcode detection result basic class HmsScan. |