public class Barcode2DWithSoft
extends java.lang.Object
注意:
Attention:
1、使用前请确认您的机器已安装此模块。
1. Make sure the module is installed before using your device.
2、要正常使用模块需要在\libs\armeabi\目录放置相应的.so文件。
2. put the related .so file in directory \libs\armeabi\ then the module can be used normally.
3、在操作设备前需要调用 open(Context)
打开设备,使用完后调用 close()
3. call the open(Context)
to switch on the device before using, call the close()
to switch off device after using.
关闭设备
switch off device
4、需要申请摄像头权限
4. Need camera access
Modifier and Type | Class and Description |
---|---|
static class |
Barcode2DWithSoft.CODETYPE |
static class |
Barcode2DWithSoft.HardwareType
扫描头类型
|
static interface |
Barcode2DWithSoft.PictureCallback
拍照回调接口(只支持mot扫描头)
capture call-back interface(supports MOTO scanning module only) |
static interface |
Barcode2DWithSoft.ScanCallback
扫码回调接口(只支持moto扫描头)
scanning barcode call-back interface |
static class |
Barcode2DWithSoft.ScanerParamNum
扫描头参数编号(只支持moto扫描头)
Scanning module parameter codes( supports MOTO scanning module only) |
static class |
Barcode2DWithSoft.ScanerParamVal
扫描头参数值(只支持moto扫描头)
Scanning module parameter value(support MOTO scanning module only) |
static class |
Barcode2DWithSoft.ScanerPropertyNum
扫描头属性编号(只支持mot扫描头)
Scanning module property code( supports MOTO module only) |
static interface |
Barcode2DWithSoft.VideoCallback
视频回调接口(只支持mot扫描头)
vedio call-back interface(supports scanning module only) |
Modifier and Type | Method and Description |
---|---|
boolean |
close()
关闭二维扫描设备
Switch off 2D barcode scannning device |
void |
disableAllCodeTypes()
禁用所有类型条码识别
deactivate all types of barcodes identification |
void |
enableAllCodeTypes()
开启所有类型条码识别
activate all types of barcodes identification |
boolean |
enableBarcode(SymbologyConfiguration.BarcodeSymbologyID symbologyID,
SymbologyConfig symbolog)
开启条码(此函数目前只支持6603扫描头)
activate barcode(this formula supports 6603 scanning module only) |
int |
fWUpdate(java.lang.String filePath,
boolean forceDownload,
boolean ignoreSignature) |
com.imagealgorithmlab.barcode.SymbologySettingItem[] |
getCodeTypeList() |
Decoder |
getDecoder() |
Barcode2DWithSoft.HardwareType |
getHardwareType() |
static Barcode2DWithSoft |
getInstance()
获取二维软解码操作实例
Acquire 2D soft decode operation example |
int |
getNumParameter(int paramNum)
获取扫描头参数(此函数目前只支持moto扫描头)
Acquire scanning module parameter(this formula supports MOTO scanning module only) |
int |
getNumProperty(int propNum)
获取扫描头属性(此函数目前只支持moto扫描头)
acquire scanning module property(this formula supports MOTO scanning module only) |
static int |
getScannerIdFromCamera(Context context)
此函数目前只支持moto 扫描头
This formula supports MOTO scanning module only. |
static int |
getScannerIdFromCamera2(Context context)
此函数目前只支持moto 扫描头
This formula supports MOTO scanning module only. |
java.lang.String |
getStrParameter(int paramNum)
获取扫描头参数(此函数目前只支持moto扫描头)
acquire scanning module parameter(this formula supports MOTO scanning module only) |
java.lang.String |
getStrProperty(int propNum)
获取扫描头属性(此函数目前只支持moto扫描头)
acquire scanning module property(this formula supports MOTO scanning module only) |
boolean |
isPowerOn()
判断设备是否上电
Determine whether the device is powered on. |
static boolean |
isUpAndroid7() |
boolean |
open(Context context)
打开二维扫描设备
Switch on 2D scanning device |
int |
readCameraState()
读取camera状态
read camera status |
int |
readScannerCameraId()
读取camera id
read camera id |
void |
scan()
触发二维条码扫描
Trigger 2D barcode scanning function |
boolean |
setCodeTypeOnAndOff_IA400S(Barcode2DWithSoft.CODETYPE codetype,
boolean enable)
只支持擎亚扫描头
|
void |
setDefaultParameters()
重置扫描头参数(此函数目前只支持moto扫描头)
reset scanning module parameter(this formula supports MOTO scanning module only) |
void |
setLicense_IA400S(java.lang.String license_IA400S) |
void |
setNoDisplayMode()
此函数目前只支持moto扫描头
This formula supports MOTO scanning module only |
boolean |
setParameter(int paramNum,
int paramVal)
设置扫描头参数(此函数目前只支持moto扫描头)
Setup scanning module parameter( this formula supports MOTO scanning module only) |
boolean |
setParameter(int paramNum,
java.lang.String paramVal)
设置扫描头参数(此函数目前只支持moto扫描头)
|
void |
setPreviewDisplay(SurfaceHolder holder)
设置预览控件(只支持mot扫描头)
setup preview control( supports MOTO scanning module only.) |
void |
setScanCallback(Barcode2DWithSoft.ScanCallback sc)
设置回调对象接收条码数据,主线程回调
Setup call-back target to acquire barcode data. |
void |
setTimeOut(int time)
设置超时时间
setup time-out duration |
boolean |
startHandsFree()
设置连续扫描(只支持moto扫描头)
Setup continuous scanning function(supports MOTO scanning module only) |
void |
startPreview()
启动预览(只支持mot扫描头)
activate preview(suppots MOTO scanning module only) |
void |
startViewFinder(Barcode2DWithSoft.VideoCallback cb)
开始捕捉帧视频模式(只支持mot扫描头)
Start capture frame vedio mode(support MOTO scanning module only) |
boolean |
stopHandsFree()
停止连续扫描(只支持moto扫描头)
Stop continuous scanning (support MOTO scanning module) |
void |
stopPreview()
停止预览(只支持mot扫描头)
Stop preview(supports MOTO scanning module only) |
void |
stopScan()
终止扫描
Scanning terminated |
void |
takePicture(Barcode2DWithSoft.PictureCallback cb)
扫描头拍照(只支持moto扫描头)
scanning module capture(supports MOTO scanning module) |
void |
writeCameraState(int status)
写入camera状态
write in camera status |
void |
writeScannerCameraId(int id)
写入camera id
write in camera id |
void |
writeScannerState(int status)
写入2D软解码扫描头状态
write in 2D soft decode scanning module status |
public boolean isPowerOn()
public static Barcode2DWithSoft getInstance()
public boolean open(Context context)
context
- Contextpublic static int getScannerIdFromCamera(Context context)
context
- Contextpublic static int getScannerIdFromCamera2(Context context)
context
- Contextpublic void scan()
public void stopScan()
public void setScanCallback(Barcode2DWithSoft.ScanCallback sc)
sc
- 回调对象public void setNoDisplayMode()
public boolean setParameter(int paramNum, int paramVal)
paramNum
- paramNumparamVal
- paramValpublic boolean setParameter(int paramNum, java.lang.String paramVal)
paramNum
- paramNumparamVal
- paramValpublic int getNumParameter(int paramNum)
paramNum
- paramNumpublic java.lang.String getStrParameter(int paramNum)
paramNum
- paramNumpublic void setDefaultParameters()
public int getNumProperty(int propNum)
propNum
- propNumpublic java.lang.String getStrProperty(int propNum)
paramNum
- paramNumpublic void enableAllCodeTypes()
public void disableAllCodeTypes()
public boolean enableBarcode(SymbologyConfiguration.BarcodeSymbologyID symbologyID, SymbologyConfig symbolog)
symbologyID
- 要开启的条码IDsymbolog
- 具体条码参数public void takePicture(Barcode2DWithSoft.PictureCallback cb)
cb拍照回调接口
- cb capture call-back interfacepublic void setPreviewDisplay(SurfaceHolder holder) throws java.io.IOException
holder
- SurfaceHolderjava.io.IOException
public void startViewFinder(Barcode2DWithSoft.VideoCallback cb)
cb
- public void startPreview()
public void stopPreview()
public int fWUpdate(java.lang.String filePath, boolean forceDownload, boolean ignoreSignature)
filePath
- forceDownload
- ignoreSignature
- public boolean close()
public void writeScannerState(int status)
public void writeCameraState(int status)
public int readCameraState()
public void writeScannerCameraId(int id)
public Decoder getDecoder()
public void setTimeOut(int time)
time
- public int readScannerCameraId()
public boolean startHandsFree()
public boolean stopHandsFree()
public com.imagealgorithmlab.barcode.SymbologySettingItem[] getCodeTypeList()
public boolean setCodeTypeOnAndOff_IA400S(Barcode2DWithSoft.CODETYPE codetype, boolean enable)
codetype
- enable
- public void setLicense_IA400S(java.lang.String license_IA400S)
license_IA400S
- 擎亚扫描头授权码public Barcode2DWithSoft.HardwareType getHardwareType()
public static boolean isUpAndroid7()