QR / Barcode Scanner

It recognizes QR / Barcode.

Starting / Stopping the Scanner
Using the Scanning Information

Starting / Stopping the 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();
    ...
}

Using the Scanning Information

When you illuminate the QR / Barcode, the code name is 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"));
        }
        ...
    }
}