Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

QR Scanner
Started by Michael W. Aug 12 2015 01:53 PM

368 replies to this topic
release android ios
[TOPIC CONTROLS]
Page 2 of 15 1 2 3 4 »
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#26

Lerg

[GLOBAL: userInfoPane.html]
Lerg
  • Contributor

  • 535 posts
  • Corona Staff

mongkon6, have you tried building only the sample project? https://github.com/Lerg/plugins-sample-qrscanner
Can you send me your APK that crashes?



[TOPIC: post.html]
#27

yosu

[GLOBAL: userInfoPane.html]
yosu
  • Contributor

  • 520 posts
  • Corona SDK

Great job! Just donated and will be donating more :)



[TOPIC: post.html]
#28

Lerg

[GLOBAL: userInfoPane.html]
Lerg
  • Contributor

  • 535 posts
  • Corona Staff

Great job! Just donated and will be donating more :)

Yay! Thank you!



[TOPIC: post.html]
#29

yosu

[GLOBAL: userInfoPane.html]
yosu
  • Contributor

  • 520 posts
  • Corona SDK

Dear Lerg,

 

Just wondering whether it is possible to :

 

  1. Put in own or customize the top-bar. (e.g. set the text color, background color, width/height of the bar, x/y of the bar )
  2. Mask out the background with a black-transparent, and only leave the scanning-box to be visible
  3. Put in own or customize the dashed-white lines

 

 

 

Thanks



[TOPIC: post.html]
#30

runewinse

[GLOBAL: userInfoPane.html]
runewinse
  • Contributor

  • 485 posts
  • Corona SDK

Thanks for the plugin. This is exactly what I need for my pet project  :)

 

Unfortunately it crashes my app.This seems to happen when the qr scanner recognizes a qr code, but the listener is never called (or so it seems).

 

Your example app works very well, but adding the same code to my existing project crashed the app. So I started to minimize my app (which uses composer) to the bare minimum. Attached is this simplified app. At least in my place this crashes consistently.

 

It may very wel be something stupid about how I've implementing things that results in the crash, but I'm not able to figure it out...

 

Please have a go and see if you get the same behaviour.

 

Thanks!

Attached Files


  • estefanyhinojos likes this

[TOPIC: post.html]
#31

MrNeo

[GLOBAL: userInfoPane.html]
MrNeo
  • Observer

  • 12 posts
  • Corona SDK

mongkon6, have you tried building only the sample project? https://github.com/Lerg/plugins-sample-qrscanner
Can you send me your APK that crashes?

This is APK of my project https://www.dropbox.com/s/1661gd0b47xqfbb/PayAllDev.apk?dl=0

you can goto register section and scroll to scan QR code in bottom screen.



[TOPIC: post.html]
#32

MrNeo

[GLOBAL: userInfoPane.html]
MrNeo
  • Observer

  • 12 posts
  • Corona SDK

mongkon6, have you tried building only the sample project? https://github.com/Lerg/plugins-sample-qrscanner
Can you send me your APK that crashes?

My android oppo and samsung work fine with you sample project.



[TOPIC: post.html]
#33

Lerg

[GLOBAL: userInfoPane.html]
Lerg
  • Contributor

  • 535 posts
  • Corona Staff

runewinse, mongkon6,

Just submitted a possible fix. Please try when it's ready.



[TOPIC: post.html]
#34

Lerg

[GLOBAL: userInfoPane.html]
Lerg
  • Contributor

  • 535 posts
  • Corona Staff

Just wondering whether it is possible to :

  1. Put in own or customize the top-bar. (e.g. set the text color, background color, width/height of the bar, x/y of the bar )
  2. Mask out the background with a black-transparent, and only leave the scanning-box to be visible
  3. Put in own or customize the dashed-white lines

Some of it is possible to implement. I can do it later on. 



[TOPIC: post.html]
#35

runewinse

[GLOBAL: userInfoPane.html]
runewinse
  • Contributor

  • 485 posts
  • Corona SDK

runewinse, mongkon6,

Just submitted a possible fix. Please try when it's ready.

 

Great! How do we know when it's ready?



[TOPIC: post.html]
#36

Lerg

[GLOBAL: userInfoPane.html]
Lerg
  • Contributor

  • 535 posts
  • Corona Staff

Great! How do we know when it's ready?

Should be less than 1 hour. When you run the Simulator you can spot the message that the plugin has been updated.



[TOPIC: post.html]
#37

MrNeo

[GLOBAL: userInfoPane.html]
MrNeo
  • Observer

  • 12 posts
  • Corona SDK

Yesss! Now It's work perfect on my Oppo & Samsung.

Now, My project is work on iOS/Android.

Thanks you for this plugin, Will donate to you.  :D



[TOPIC: post.html]
#38

Lerg

[GLOBAL: userInfoPane.html]
Lerg
  • Contributor

  • 535 posts
  • Corona Staff

Great to hear it! This seems to be the last bug, now it's really ready for everyone to use.



[TOPIC: post.html]
#39

runewinse

[GLOBAL: userInfoPane.html]
runewinse
  • Contributor

  • 485 posts
  • Corona SDK

Thanks Lerg!

 

It does indeed seem to work very well now!



[TOPIC: post.html]
#40

runewinse

[GLOBAL: userInfoPane.html]
runewinse
  • Contributor

  • 485 posts
  • Corona SDK

Donated!



[TOPIC: post.html]
#41

Lerg

[GLOBAL: userInfoPane.html]
Lerg
  • Contributor

  • 535 posts
  • Corona Staff

Donated!

Thank you!



[TOPIC: post.html]
#42

runewinse

[GLOBAL: userInfoPane.html]
runewinse
  • Contributor

  • 485 posts
  • Corona SDK

Thank you!

 

BTW, how is that NFC plugin coming along?  :)



[TOPIC: post.html]
#43

Lerg

[GLOBAL: userInfoPane.html]
Lerg
  • Contributor

  • 535 posts
  • Corona Staff

BTW, how is that NFC plugin coming along?  :)

I will work on it in September, but first I need to find a phone with NFC support. Mine doesn't have it.



[TOPIC: post.html]
#44

runewinse

[GLOBAL: userInfoPane.html]
runewinse
  • Contributor

  • 485 posts
  • Corona SDK

I will work on it in September, but first I need to find a phone with NFC support. Mine doesn't have it.

 

Well, I guess things are a bit difficult without a device to test on...

 

In the meantime, I have a question about the QR scanner.

 

Since the scanner takes a few seconds to start, I show a little message/symbol just to show the user that something is going on. The plan was to remove this message/symbol in the qr listener function, but as it turns out, this is not called if the user aborts the scanning (left arrow or back button (Android)).

 

Now, this is not a big issue for me personally as I can use a timer and auto remove the message/symbol.

 

But maybe the listener should be called anyway (with message = nil or something)? Just so that the caller app has an idea about an aborted scan?



[TOPIC: post.html]
#45

Lerg

[GLOBAL: userInfoPane.html]
Lerg
  • Contributor

  • 535 posts
  • Corona Staff

Well, I guess things are a bit difficult without a device to test on...

 

In the meantime, I have a question about the QR scanner.

 

Since the scanner takes a few seconds to start, I show a little message/symbol just to show the user that something is going on. The plan was to remove this message/symbol in the qr listener function, but as it turns out, this is not called if the user aborts the scanning (left arrow or back button (Android)).

 

Now, this is not a big issue for me personally as I can use a timer and auto remove the message/symbol.

 

But maybe the listener should be called anyway (with message = nil or something)? Just so that the caller app has an idea about an aborted scan?

I tried making an event argument with event.isError, event.errorMessage and event.message, but this over complicates the plugin code. My goal is to make many plugins in minimal time, that assumes less functionality for now. But later on, for sure I will add more functionality.

 

I could make another listener onCancel() or something, but that's ugly.

For now, timer function to hide your message is most concise solution.



[TOPIC: post.html]
#46

runewinse

[GLOBAL: userInfoPane.html]
runewinse
  • Contributor

  • 485 posts
  • Corona SDK

I don't think the event.xxx system complicates anything. Well, maybe on your side...  :)

 

Actually I think it is much cleaner that what I have to do now. I've tried to time the message but the timer seems to be halted by the plugin? Is this possible? I know next to nothing about corona plugins.

 

Anyway, this means that if the message is not removed before the plugin shows/starts, it will be visible even after the plugin is finished, which looks bad.

 

I had to set the timer to 300ms to be sure that the message is removed before the plugin starts. I'm not very comfortable with this way of working though. Maybe the timing is different on other devices than mine and 300ms is not a good number.



[TOPIC: post.html]
#47

Lerg

[GLOBAL: userInfoPane.html]
Lerg
  • Contributor

  • 535 posts
  • Corona Staff

I don't think the event.xxx system complicates anything. Well, maybe on your side...  :)

 

Actually I think it is much cleaner that what I have to do now. I've tried to time the message but the timer seems to be halted by the plugin? Is this possible? I know next to nothing about corona plugins.

 

Anyway, this means that if the message is not removed before the plugin shows/starts, it will be visible even after the plugin is finished, which looks bad.

 

I had to set the timer to 300ms to be sure that the message is removed before the plugin starts. I'm not very comfortable with this way of working though. Maybe the timing is different on other devices than mine and 300ms is not a good number.

Yeah, I was talking about ObjC and Java sides. Trivial things may be very complicated there.

Actually, there is a possibility that a system event will be fired when QR Scanner is closed.
https://docs.coronalabs.com/api/event/system/type.html
applicationResume that is, I don't have time to check at the moment, but you can try.



[TOPIC: post.html]
#48

runewinse

[GLOBAL: userInfoPane.html]
runewinse
  • Contributor

  • 485 posts
  • Corona SDK

Indeed it does! A great tip! Everything works smoothly now. Thanks, Lerg!



[TOPIC: post.html]
#49

anil8

[GLOBAL: userInfoPane.html]
anil8
  • Contributor

  • 124 posts
  • Corona SDK

@runewinse,

 

 

Would you be willing to share the code with the rest of the community as it seems a useful addition to the plugin?



[TOPIC: post.html]
#50

runewinse

[GLOBAL: userInfoPane.html]
runewinse
  • Contributor

  • 485 posts
  • Corona SDK

@runewinse,

 

 

Would you be willing to share the code with the rest of the community as it seems a useful addition to the plugin?

 

What part of the code are you thinking of? The message part that is hidden by the applicationResume event?




[topic_controls]
Page 2 of 15 1 2 3 4 »
 
[/topic_controls]

Also tagged with one or more of these keywords: release, android, ios