I'm developing a mobile app(android & ios), which enables user to scan QR code, using Zxing.
At this moment, I've tried out the QR scanner demo provided in codenameone_docs_demos_20130307.zip, which works in Ipad.
Questions:
Is it possible to configure the scan area, to be smaller? (The default demo is difficult for me to scan SMALL QR code, the default scanning area is too big)
Is there a way to configure the scanner UI? E.g: a line or point, to facilitate user to focus.
if(CodeScanner.getInstance() != null) {
final Button qrCode = new Button("Scan QR");
cnt.addComponent(qrCode);
qrCode.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
CodeScanner.getInstance().scanQRCode(new ScanResult() {
public void scanCompleted(String contents, String formatName, byte[] rawBytes) {
qrCode.setText("QR: " + contents);
}
public void scanCanceled() {
}
public void scanError(int errorCode, String message) {
}
});
}
});
final Button barCode = new Button("Scan Barcode");
cnt.addComponent(barCode);
barCode.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
CodeScanner.getInstance().scanBarCode(new ScanResult() {
public void scanCompleted(String contents, String formatName, byte[] rawBytes) {
barCode.setText("Bar: " + contents);
}
public void scanCanceled() {
}
public void scanError(int errorCode, String message) {
}
});
}
});
}