public class Barcode2DWithSoft
extends java.lang.Object
注意:
1、使用前请确认您的机器已安装此模块。
2、要正常使用模块需要在\libs\armeabi\目录放置相应的.so文件。
3、在操作设备前需要调用 open(Context)
打开设备,使用完后调用 close()
关闭设备
4、需要申请摄像头权限
Modifier and Type | Class and Description |
---|---|
static interface |
Barcode2DWithSoft.PictureCallback
拍照回调接口
|
static interface |
Barcode2DWithSoft.ScanCallback
扫码回调接口
|
static class |
Barcode2DWithSoft.ScanerParamNum
扫描头参数编号
|
static class |
Barcode2DWithSoft.ScanerParamVal
扫描头参数值
|
static class |
Barcode2DWithSoft.ScanerPropertyNum
扫描头属性编号
|
static interface |
Barcode2DWithSoft.VideoCallback
视频回调接口
|
Modifier and Type | Method and Description |
---|---|
boolean |
close()
关闭二维扫描设备
|
void |
disableAllCodeTypes()
禁用所有类型条码识别
|
void |
enableAllCodeTypes()
开启所有类型条码识别
|
static Barcode2DWithSoft |
getInstance()
获取二维软解码操作实例
|
int |
getNumParameter(int paramNum)
获取扫描头参数
|
int |
getNumProperty(int propNum)
获取扫描头属性
|
static int |
getScannerIdFromCamera(Context context) |
static int |
getScannerIdFromCamera2(Context context) |
java.lang.String |
getStrParameter(int paramNum)
获取扫描头参数
|
java.lang.String |
getStrProperty(int propNum)
获取扫描头属性
|
boolean |
isPowerOn()
判断设备是否上电
|
boolean |
open(Context context)
打开二维扫描设备
|
void |
scan()
触发二维条码扫描
|
void |
setDefaultParameters()
重置扫描头参数
|
void |
setNoDisplayMode() |
boolean |
setParameter(int paramNum,
int paramVal)
设置扫描头参数
|
boolean |
setParameter(int paramNum,
java.lang.String paramVal)
设置扫描头参数
|
void |
setPreviewDisplay(SurfaceHolder holder)
设置预览控件
|
void |
setScanCallback(Barcode2DWithSoft.ScanCallback sc)
设置回调对象
|
void |
startPreview()
启动预览
|
void |
startViewFinder(Barcode2DWithSoft.VideoCallback cb)
开始捕捉帧视频模式
|
void |
stopPreview()
停止预览
|
void |
stopScan()
终止扫描
|
void |
takePicture(Barcode2DWithSoft.PictureCallback cb)
扫描头拍照
|
public boolean close()
public void disableAllCodeTypes()
public void enableAllCodeTypes()
public static Barcode2DWithSoft getInstance()
public int getNumParameter(int paramNum)
paramNum
- public int getNumProperty(int propNum)
propNum
- public static int getScannerIdFromCamera(Context context)
public static int getScannerIdFromCamera2(Context context)
public java.lang.String getStrParameter(int paramNum)
paramNum
- public java.lang.String getStrProperty(int propNum)
paramNum
- public boolean isPowerOn()
public boolean open(Context context)
public void scan()
public void setDefaultParameters()
public void setNoDisplayMode()
public boolean setParameter(int paramNum, int paramVal)
paramNum
- paramVal
- public boolean setParameter(int paramNum, java.lang.String paramVal)
paramNum
- paramVal
- public void setPreviewDisplay(SurfaceHolder holder) throws java.io.IOException
holder
- java.io.IOException
public void setScanCallback(Barcode2DWithSoft.ScanCallback sc)
sc
- 回调对象public void startPreview()
public void startViewFinder(Barcode2DWithSoft.VideoCallback cb)
cb
- public void stopPreview()
public void stopScan()
public void takePicture(Barcode2DWithSoft.PictureCallback cb)
cb
-