QR Scanner

To : [member=‘Lerg’]

Thank you, it was added to the document, so I was able to confirm it.

http://docs.spiralcodestudio.com/plugin/qrscanner/event/show/errorCode/

But now the link to this document has been disconnected from Corona’s site.

Please link to the page of the plugin.

Also, I am doing an event in Tokyo, but the problem of the plug-in is emerging.

There are 2 problems I am checking.

1. It seems that you can not set permissions on Android 7 or later.

2. Suspected interruption failure on Android 4.

I write the details in another comment.

To : [member=‘Lerg’]

Problem#1. I can not set the permissions properly.

There was no problem with older Android, but when you install it on Android 7, you will encounter a problem that permission setting is not done.

Executing the show command of QRScnner in the application will only display a warning dialog.

Therefore, the user can not set the permission even for the first installation.

In this case, the user needs to change the Permission setting of the application from the Android setting.

This is a very high hurdle for beginner users.

Perhaps I think the same problem that bothers [member=‘runewinse’].

>> Corresponding part in “build.settings”…

android = { useGoogleServicesJson = true, usesPermissions = { "android.permission.INTERNET", "android.permission.ACCESS\_NETWORK\_STATE", "android.permission.CAMERA", "android.permission.ACCESS\_FINE\_LOCATION", "android.permission.ACCESS\_COURSE\_LOCATION", }, usesFeatures = { { name="android.hardware.camera", required=true }, { name="android.hardware.location", required=true }, { name="android.hardware.location.gps", required=true }, }, }

>> Warning dialog…

20180504-WarningDialog.png

>> App setting screen…

20180504-Settings.jpg

Well, actually you can ask the user for permission from inside the app like this:

 local options = { appPermission = "Camera", urgency = "Critical", listener = cbFunction, rationaleTitle = s.str("I need camera access!"), rationaleDescription = s.str("The app needs camera access to be able to scan for QR codes. Please give the app access to the camera!"), settingsRedirectTitle = "Alert", settingsRedirectDescription = s.str("The app needs camera access to be able to scan for QR codes. Please give the app access to the camera!") } native.showPopup( "requestAppPermission", options )

Is this what you’re looking for?

cbFunction would then be the part of the code where you call the plugin scanner. 

I have done some trickery (part of the code shown above) so when the user taps the scan button I first check if the app has permission and if not run the code above. This is for Android. For iOS I just have to hope that the permissons are in order, because I don’t know how to detect permissions in iOS and the only thing that the user will experience is that the QR scanner fails.

That is what I asked Lerg for. If it’s possible, on some lower level that he has access to, to ask the user for permission to access the camera FROM WITHIN the plugin, so that we users (of the plugin) do not have to deal with this mess.

To: [member=‘runewinse’]  /  Thank you for a good idea.

There is no problem with all versions of iOS, the setting permission dialog will be displayed first.

The problem is the new version of Android.

If it gets an error at runtime, it seems good because it seems that you can authorize by running your code.

However, I feel that this is not an essential operation.

To: [member=‘Lerg’]  /  Do you understand our problem?

Can not solve this problem?

Also I am currently reviewing the second issue.

There is a problem with certain smartphones on older Android.

It seems that there are some models that interrupt functions are not called.

It may be a complex problem and I am checking it.

To: [member=‘Lerg’] 

Problem#2. An event does not occur.

Although the camera operates with the old model, no interrupt is generated.

Sometimes interruption occurs when pause and reunion are repeated.

I got a model that will happen 100%.

Spec sheet: (Japanese)

  https://www.kyocera.co.jp/prdct/telecom/consumer/lineup/kyv32/spec/index.html

Model summary:

  Kyocera, KYV32, Japan, Android-4.4.4, Kernel-3.4.0, Build-101.0.1f40

Extracted from logcat:

  http://web.editey.com/12D192dXGxfDqMGZSvu94KzUMJ1kQ2NYi/20180509-logcat-filter_coronaAndSample.html

Is there any other way I can confirm the problem?

CyberCatfish, I am pretty sure there is no problem with Android 7 in general. When a permission was denied, it’s denied by the user. When you reinstall the app, the denial is still active. But for the new users who install it for the first time it should not be a problem. Try a fresh device.

Unfortunately there is nothing more I can do from within the plugin about permissions.

About Kyocera, KYV32 - in the logcat there is no error, you say it never displays the scanner view? That’s really odd. Is that device generally stable? I mean it could be a buggy device on it’s own. Can you record a video of whats happening? Maybe I will see something.

I am in the process of restoring the website and fixing those urls, thanks.

@Lerg,

I have the plugin running (Android) but am getting unexpected results.  Could you confirm this means that:

 qrsanner.show( { listener = onCompleteScanner, symbols = {'code39', 'code39mod43'}, overlays = { searching = { filename = "images/searching.png", baseDir = system.ResourceDirectory }, mismatch = { filename = "images/mismatch.png", baseDir = system.ResourceDirectory }, found = { filename = "images/found.png", baseDir = system.ResourceDirectory }, } }) 
  1. including the symbols variable should limit formats to the ones identified

         problem: in my code and your sample, the plugin is returning codes from ean-8, ean-13, databar and others.

         it appears that the scanner is reading a code, then running through the entire set of formats (ignoring the symbols variable) and returning the first that is close.

  1. is the plugin defaulting the scanned area within the non-grey portion of files in the overlays table.  In your sample code, the mask option doesnt match up with the overlays.  Can these or shouldn’t these be synced?  It IS loading the 3 overlays at the proper times.  I’m trying to sync up with a narrower area closer to the top of the screen, but if I try to scan from a sheet of codes (inventory sheet) it pulls the wrong code.

Thanks

Dave

@davida6, hi. I have to check the codes, so will reply a bit later.

Mask and overlays are independent. You should try to match overlay image with the masking, but it’s not required.

He @Lerg

Able to find anything?

Dave

Hi Guys,

This is almost one year from the last comment in this topic

i’m building a new system that requires reading barcode (normal barcode from insurance claim forms)

so i have no option but to happily purchase this plugin :slight_smile:

however, i need to know 3 things:

  1. Could Corona allow each plugin to be somehow tested prior to purchasing … i know this is not easy, and it requires work from corona and all plugin providers but it is good to make sure if the plugin is what one really needs or not
  2. if i purchase the plugin for a year, do i have to keep purchasing it every year even if i don’t make new build … meaning that if i upload a build to play store, and i did not renew the annual purchase, would the features stop to function?
  3. Finally i need to make sure that it is working with Corona’s latest build before i make the purchase … you know what i’m talking about… 64 bit issues and stuff…

can anyone help

i tried to build prior to purchasing and this is what i got

WARNING: issue found in D:\Downloads\plugins-sample-qrscanner-master\plugins-sample-qrscanner-master\build.settings: WARNING: deprecated key: settings.iphone.plist.CFBundleIconFile (string) Testing credentials for 'D:\Lua\Publish\PopOpp\com.kakula.gmail.gunmaster.keystore': Picked up JAVA\_TOOL\_OPTIONS: -Duser.language=en jar signed. Using custom build id from app bundle: 00000 (AppSettings.lua) Using custom Build Id 00000 @ver \> NUL Picked up JAVA\_TOOL\_OPTIONS: -Duser.language=en Exception in thread "DisconnectableInputStream source reader" org.gradle.api.UncheckedIOException: java.io.IOException: Access is denied at org.gradle.internal.UncheckedException.throwAsUncheckedException(UncheckedException.java:61) at org.gradle.internal.UncheckedException.throwAsUncheckedException(UncheckedException.java:41) at org.gradle.util.DisconnectableInputStream$1.run(DisconnectableInputStream.java:125) at java.base/java.lang.Thread.run(Thread.java:835) Caused by: java.io.IOException: Access is denied at java.base/java.io.FileInputStream.readBytes(Native Method) at java.base/java.io.FileInputStream.read(FileInputStream.java:273) at java.base/java.io.BufferedInputStream.fill(BufferedInputStream.java:252) at java.base/java.io.BufferedInputStream.read1(BufferedInputStream.java:292) at java.base/java.io.BufferedInputStream.read(BufferedInputStream.java:351) at org.gradle.util.DisconnectableInputStream$1.run(DisconnectableInputStream.java:96) ... 1 more Error while fetching plugins ERROR: plugin could not be validated: plugin.qrscanner (com.spiralcodestudio) ERROR: Activate plugin at: https://marketplace.coronalabs.com/plugin/com.spiralcodestudio/plugin.qrscanner ERROR: exiting due to plugins above not being activated. FAILURE: Build failed with an exception. \* Where: Build file 'C:\Users\tariq\AppData\Local\Temp\Corona Labs\CLtmpa01224\template\app\build.gradle.kts' line: 573 \* What went wrong: Error while fetching plugins \* Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. \* Get more help at https://help.gradle.org BUILD FAILED in 25s Android build failed (1) after 29 seconds

Hi kakula,

  1. Sadly no.

  2. You don’t have to renew subscription to keep published apps working. You only need to purchase the plugin again when you want to make and update to your apps or create a new one.

  3. It’s working fine, recently I’ve update the plugin for the 64 bit support.

I hope that helps!

Thanks man

that helped a lot

i will make the purchase now

I have been unable to purchase the QRscanner module. I have tried at least 5 times, restarting every time. The credit card is fine, works elsewhere. Here is the error I get:

Errors have occurred, please validate your input and re-try. Error details:

  • No such token: card_…

If errors persist, please contact customer support.

 

Any idea what is going wrong? Is this a problem in the marketplace?

I saw the last update of this plugin on the marketplace was May 10 2018

And your website seems not working:

https://spiralcodestudio.com/

Is the plugin still active or abandoned?

apps30, website for plugins is working - docs.spiralcodestudio.com 

Active. Updated just a few days ago for better iOS 13 compatibility.

It seems not working on my Android 10 when I open the scanner on my Nokia 7.1, the app crashed and closed down. It works on another devices and iOS. 

Not sure if it is related to Android System Webview" or not. I updated my “Android System Webview” to “80.0.3987.149” yesterday and I found the QR Scanner is not working now 

It should not be related to webview, can you please send the output of logcat when the crash happens? That might tell the reason.

I am not a native app developer. I will check how to get the log from my Android 10. But when I call the qrscanner.show(), the app will crash (just exit the app) without showing any error.

it’s working perfectly on my side

it might be a compatibility issue with the phone you are using or code problem … sometimes the cause would be JDK version!

post your code if you wish

The QR scanner works fine on my Android 10 (Samsung Note 9). I am on Windows @ java :

java version "1.8.0\_241" Java(TM) SE Runtime Environment (build 1.8.0\_241-b07) Java HotSpot(TM) Client VM (build 25.241-b07, mixed mode)

Hope it helps.