How do you implement a QR-Scanner in CN1?

63 views
Skip to first unread message

Beru

unread,
Sep 10, 2013, 6:09:18 AM9/10/13
to codenameone...@googlegroups.com
Hello there,

first my compliment for your great work you did with codenameone! I'm currently making my first app with it and it works very well.
But now I'm trying to implement the CodeScanner and i have difficulty to make it work the way i think it should work.

When I implement it the way like in the camera example given in the KitchenSink app, i get a prompt to install the Zxing app from the Play Store.
But i want it to work right out of the box, so the user doesn't need to care about extra installations. Is that possible?

I've seen in the Zxing demo that it can work this way! But this example is somewhat to complex for me. I don't understand where the StateMachine etc is coming from and what it's all about.
But you said that this example is out-dated anyway, so... how is it supposed to work just with CodeScanner and ScanResult? I don't see any zxing-libs there, too?!

I've read every thread concerning this topic, but I didn't come far. Hope somebody can help me out in this one.
Greets,
Beru

Chen Fishbein

unread,
Sep 10, 2013, 6:22:09 AM9/10/13
to codenameone...@googlegroups.com, beru...@gmail.com
Hi,
The code scan on android launches an intent that knows how to scan, the implementation tries to launch from a list of some popular scanner apps and if none is installed it will popup the play store for installation.

Beru

unread,
Sep 11, 2013, 4:50:03 AM9/11/13
to codenameone...@googlegroups.com, beru...@gmail.com


On Tuesday, September 10, 2013 12:22:09 PM UTC+2, Chen Fishbein wrote:
Hi,
The code scan on android launches an intent that knows how to scan, the implementation tries to launch from a list of some popular scanner apps and if none is installed it will popup the play store for installation.

Ah ok, i see.
But if you wanted to provide an included scanner, how would you proceed? Can you place the core and javase libs of zxing somewhere and make it work or what steps need to be taken?

Chen Fishbein

unread,
Sep 11, 2013, 5:17:29 AM9/11/13
to codenameone...@googlegroups.com, beru...@gmail.com
you can place android jars under the native root dir under your project and create a native interface to access the jar api, but I wouldn't recommend going this path, why the current implementation is not sufficient most of the apps that uses barcode functionality are using intents on android.
Reply all
Reply to author
Forward
0 new messages