文件名称:usb扫描枪数据获取解析
文件大小:8KB
文件格式:JAR
更新时间:2021-06-07 16:43:39
android usb扫描枪
public class ChiceScanGunActivity extends Activity{ @Override protected boolean onKeyEvent(KeyEvent event) { if (event.getAction() == KeyEvent.ACTION_DOWN) { int keyCode = event.getKeyCode(); if (keyCode <= 6) { return false; } if (mScanGun.isMaybeScanning(keyCode, event)) { return true; } } return true; } @Override public void onCreate() { super.onCreate(); //TODO mScanGun = new ScanGun(new ScanGunCallBack() { @Override public void onScanFinish(String scanResult) { if (!TextUtils.isEmpty(scanResult)) { Toast.makeText(DetectionService.this.getBaseContext(), "*面监听扫描枪数据:" + scanResult, Toast.LENGTH_SHORT).show(); } } }); mScanGun.setMaxKeysInterval(50); } }