目录

class info
com.huawei.hms.ml.scan.HmsScanAnalyzer
Detects barcodes using various methods for barcodes such as Code 128, Code 39, and Code 93.

Public Constructor Summary

Constructor name
HmsScanAnalyzer(android.content.Context context)
Constructs HmsScanAnalyzer.

Public Method Summary

Return typeMethod name
booleanisAvailable()
android.util.SparseArray< HmsScan>analyseFrame(MLFrame frame)
voiddestory() throws IOException
com.huawei.hmf.tasks.Task<java.util.list>analyzInAsyn(MLFrame frame)

Public Constructors

Method
public HmsScanAnalyzer (android.content.Context context)
Constructs HmsScanAnalyzer.

Parameters

Parameter nameParameter desc
contextExecution context.

Public Methods

Method
public boolean isAvailable()
Checks whether the barcode scanning function is normal.

Return

Typedesc
booleanThe 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 nameParameter desc
frameData collected by the camera, which is generated by MLFrame.

Return

Typedesc
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

Typedesc
void

Throws

Exception nameException desc
IOExceptionI/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 nameParameter desc
frameData collected by the camera, which is generated by MLFrame.

Return

Typedesc
com.huawei.hmf.tasks.Task<java.util.List<HmsScan>>Asynchronous task instance, which contains the barcode detection result basic class HmsScan.