QR / Barcode Scanner

It recognizes QR / Barcode.

Start / Stop Scanner
Use Scanning Information

Start / Stop Scanner

To start / stop Scanner, 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 Scanning Information

When you point the camera to QR / Barcode, the code name will be displayed on the screen. Refer to the following code to use the scanning 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"));
        }
        ...
    }
}