Scan canceled by QRScann Android

40 views
Skip to first unread message

tobias...@googlemail.com

unread,
Nov 27, 2018, 5:29:02 AM11/27/18
to CodenameOne Discussions
Hi,

i got the message Scan canceled on the android device.

is it posible to get an information why the scan is canceled ?

IDE: Eclipse
Desktop OS : Windows
Simulator : Android
Device : Android

Shai Almog

unread,
Nov 27, 2018, 11:26:55 PM11/27/18
to CodenameOne Discussions
Hi,
where did you get the message?
Do you see the qr scanner UI?

tobias...@googlemail.com

unread,
Nov 28, 2018, 7:39:08 AM11/28/18
to CodenameOne Discussions
I use the QRScanner from the downloaded and imported extensions-lib ... QRScanner.cn1lib

There is a popup on the android device... coursed by the method scanCanceled ... but i've no idea why...

 snippet :

try {

QRScanner.scanBarCode(new ScanResult() {
public void scanCompleted(String contents, String formatName, byte[] rawBytes) {
((TextField) view.getComponentById(MfbView.COMPONENT_HU_NUMBER)).setText(contents);
}

public void scanCanceled() {
Dialog.show("Cancelled", "Scan Cancelled", "OK", null);
}

public void scanError(int errorCode, String message) {
Dialog.show("Error", message, "OK", null);
}
});

} catch (Exception e) {
e.printStackTrace();
}

tobias...@googlemail.com

unread,
Nov 28, 2018, 8:43:34 AM11/28/18
to CodenameOne Discussions
I could also use the Zxing tool, but this one works as a single application fine, and is able to read the used barcode... i've i start the scan from the app, the Zxing App is started, but the same barcode can not be scanned, the scanner is running over the barcode but could not read it.

Shai Almog

unread,
Nov 29, 2018, 12:44:06 AM11/29/18
to CodenameOne Discussions
I think the QRScanner library depends on the code scanner cn1lib. Do you have both installed?

tobias...@googlemail.com

unread,
Nov 30, 2018, 4:51:02 AM11/30/18
to CodenameOne Discussions
thanks, it works fine.
Reply all
Reply to author
Forward
0 new messages