QR Scanner

QR Scanner

by Spiral Code Studio

View and activate on the Corona Store

 
QR code or barcode scanning and reading plugin, available for iOS and Android.
 
Documentation

This is great!

It’s work on iOS but my android Oppo and Samsung  DUO not work, Android crash when call qr scanner.

Great! Now we only need to find the bug and fix it. Please send me over your “adb logcat” logs from both devices.

This is dropbox link for android log

https://www.dropbox.com/s/et50z2b9qqnivx3/QR%20Scaner%20Android%20Log.zip?dl=0

The error is about not being able to load a library “iconv”, which is used internally inside the scanner.
What are exact models of your phones?
And what Android version?

I think I’ve fixed the issue and updated the plugin. It takes about an hour for the changes to take effect on Corona’s servers.
Please try in an hour and see if the issue is resolved.

Hey Lerg!  This is pretty cool.  Couple of things to report.

On my Google Nexus 7 (which only has a front camera), it crashes with this error:

V/Corona  ( 6176): > Class.forName: plugin.qrscanner.LuaLoader
V/Corona  ( 6176): < Class.forName: plugin.qrscanner.LuaLoader
V/Corona  ( 6176): Loading via reflection: plugin.qrscanner.LuaLoader
I/Corona  ( 6176): Runtime error
I/Corona  ( 6176): java.lang.RuntimeException: Can’t create handler inside thread that has not called Looper.prepare()
I/Corona  ( 6176): Java Stack Trace:
I/Corona  ( 6176):     android.os.Handler.<init>(Handler.java:200)
I/Corona  ( 6176):     android.os.Handler.<init>(Handler.java:114)
I/Corona  ( 6176):     android.widget.Toast$TN.<init>(Toast.java:344)
I/Corona  ( 6176):     android.widget.Toast.<init>(Toast.java:100)
I/Corona  ( 6176):     android.widget.Toast.makeText(Toast.java:258)
I/Corona  ( 6176):     plugin.qrscanner.LuaLoader.show(LuaLoader.java:207)
I/Corona  ( 6176):     plugin.qrscanner.LuaLoader$ShowWrapper.invoke(LuaLoader.java:239)
I/Corona  ( 6176):     com.ansca.corona.JavaToNativeShim.nativeResize(Native Method)
I/Corona  ( 6176):     com.ansca.corona.JavaToNativeShim.resize(JavaToNativeShim.java:372)
I/Corona  ( 6176):     com.ansca.corona.graphics.opengl.CoronaGLSurfaceView$CoronaRenderer.onSurfaceChanged(CoronaGLSurfaceView.java:374)
I/Corona  ( 6176):     com.ansca.corona.graphics.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1611)
I/Corona  ( 6176):     com.ansca.corona.graphics.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1377)
I/Corona  ( 6176): stack traceback:
I/Corona  ( 6176):     [C]: in function ‘show’
I/Corona  ( 6176):     ?: in main chunk
 

The app is also a landscape app if that matters.

On iOS on my iPhone6 , the landscape only app causes the scanning window to orient partially off screen.  In Portrait mode it works like a charm!

Rob

My oppo model R2001 Android 4.2.2 and Samsung model GalaxyA7 SM-A700FD android 4.4.4

for new plugin update I can open scanner and see front camera, but when move to QR and lock it still crash.

This is log https://www.dropbox.com/s/muo4t0mu322q0gq/QR%20Log%202.zip?dl=0

Thank you for reports! Will fix it.

Rob, I have only an iPad and I tried in the iOS Simulator from Xcode and it works fine in landscape mode, except that in the simulator I don’t see the camera, because it is absent.
Can you please make a screenshot of what’s happening?

Rob, I just committed a fixed version of the plugin for Android. Now front camera should work.

mongkon6, I am not sure what exactly causes your issue, but I’ve just made a fix based on my gut feeling. Please try when the plugin gets updated.

That’s great news! I can’t wait to get my hands on that.

Sergey,

I must congratulate and thank you for the excellent QR Scanner plugin - it was exactly what I was looking for and will be using it in my next app.

Do you have any plans of incorporating a Barcode/QR Generator as well as the reader as this too would be extremely useful.

Thanks.

It noticed today it appears to ignore the camera’s orientation. If I hold it landscape while being a landscape app, its fine. But if I rotate to portrait (even though the app is landscape only), the camera rotates around 0, 0 and stays landscape but now the device is portrait.

Rob

Rob, thanks! That helped. I’ve just pushed a fix for that.

Woo Hoo!

Thank you! Barcode / QR Generator would be a different plugin. I doubt many people will use it. If you really need it, you can hire me to make it.

Or you could use network.download() to an API service that generates them such as:  or use a webView if  you just want to display it.  There are probably similar services to generate bar codes.

Rob