QR / Barcode Reader
It recognizes QR code and Barcode.
Start / Stop Reader
Use Read Information
Start / Stop Reader
To start or stop the Reader, refer to the following code.
>CodeScanActivity.java
@Override protected void onResume() { ... TrackerManager.getInstance().startTracker(TrackerManager.TRACKER_TYPE_CODE_SCANNER); ... } @Override protected void onPause() { ... TrackerManager.getInstance().stopTracker(); ... }
Use Read Information
When you point the camera to QR code and Barcode, the code name will be displayed on the screen. Refer to the following code to use the read information.
>CodeScanActivity.java
private static class CodeScanResultHandler extends Handler { ... @Override public void handleMessage(Message msg) { ... String code = TrackerManager.getInstance().getCodeScanResult(); if (code != null && code.length() > 0) { JSONObject jsonObject = new JSONObject(code); activity.codeFormatView.setText(jsonObject.getString("Format")); activity.codeValueView.setText(jsonObject.getString("Value")); } ... } }