MergAVCam for Android

The place to discuss anything and everything about running your LiveCode on Android

Moderators: Klaus, FourthWorld, heatherlaine, robinmiller, kevinmiller

Post Reply
allengwinn
Posts: 31
Joined: Tue Aug 21, 2012 4:46 pm

MergAVCam for Android

Post by allengwinn » Tue Jan 01, 2019 1:45 am

Ok guys. What would it take to incentivize somebody doing an external for barcode/QR reading on Android devices? Or, alternatively, can Monte share the source he's already worked on for ZXing Android and I will build it this semester? Fair warning: I have never built an external for Livecode but I am willing to learn! .... Which should scare you. I'm deficient in other ways as well :)

Allen

Peter@multidesk.se
Posts: 125
Joined: Fri Oct 14, 2011 6:53 am

Re: MergAVCam for Android

Post by Peter@multidesk.se » Sun Jan 06, 2019 9:35 pm

Allen,

Have you used MergAvCam?

if not!

install "Barcode Scanner" (ZXing) on your android device.

Extract and copy this file into your project copy files pane..
AndroidQR.lcext.zip
(32.94 KiB) Downloaded 19 times

Code: Select all

on openCard
mergAVRequestMediaAccess "video"
end openCard
Start reading barcode:

Code: Select all

On StartReadQR
mergAVCamSet "visible","true"
      mergAVCamStartBarcodeReader
end StartReadQR
When a barcode is found:

Code: Select all

on mergAVCamBarcodeFound pBarcode, pBarcodeType
answer pBarcode
end mergAVCamBarcodeFound
Stop reading barcode:

Code: Select all

on StopReadQR
mergAVCamStopBarcodeReader
end StopReadQR

The biggest problem is that unless you have "Barcode Scanner" installed, the app will crash when you try to use this.
I have solved this by requesting a confirmation that "Barcode Scanner" is installed on the device (the first time it is to be used) and then saving the answer so that the question is not asked each time.


If you already knew about this, someone else might benefit from my answer :D

Good luck with your project



///Peter
/*Whats all the fuss with c# ?*/

allengwinn
Posts: 31
Joined: Tue Aug 21, 2012 4:46 pm

Re: MergAVCam for Android

Post by allengwinn » Mon Jan 07, 2019 3:32 pm

Hi Peter.... this one "https://play.google.com/store/apps/deta ... d&hl=en_US" ???

I'll play around with it. So it's interface is just calling the sam MergAVCam stuff you call for iOS?

No, I haven't played with it yet but I will!!!

Thanks.

Peter@multidesk.se
Posts: 125
Joined: Fri Oct 14, 2011 6:53 am

Re: MergAVCam for Android

Post by Peter@multidesk.se » Mon Jan 07, 2019 7:04 pm

Allen,

I have to try to keep myself sober during working hours :wink:

Forget about everything I mentioned earlier.

Yes, Install: https://play.google.com/store/apps/deta ... nt.android
Yes, Copy file AndroidQR.lcext into your projects copy files pane..

Then use:

Code: Select all

 put mergZXingGetBarcode() into tResult
I was terribly stressed when I wrote the previous reply and didn't think .... :oops:

Sorry!


///Peter
/*Whats all the fuss with c# ?*/

allengwinn
Posts: 31
Joined: Tue Aug 21, 2012 4:46 pm

Re: MergAVCam for Android

Post by allengwinn » Mon Jan 07, 2019 7:52 pm

Quite alright! How do you confirm that the barcode app is installed? Is there an "exists" something?

Peter@multidesk.se
Posts: 125
Joined: Fri Oct 14, 2011 6:53 am

Re: MergAVCam for Android

Post by Peter@multidesk.se » Mon Jan 07, 2019 8:26 pm

No, unfortunately,
The biggest problem is that unless you have "Barcode Scanner" installed, the app will crash when you try to use this.
I have solved this by requesting a confirmation that "Barcode Scanner" is installed on the device (the first time it is to be used) and then saving the answer so that the question is not asked each time.
I've used something like this:

Code: Select all

on checkScanInstall
   answer "To use this feature..." & cr & cr & "Confirm that you have installed the app" && QUOTE & "Barcode Scanner" & QUOTE && "from Google Play..." & cr & cr \
         & "if not, follow the link above for installation!" with "Cansel" or "I confirm!"
   if it is "Cansel" 
   then 
      exit to top
   else
      set the defaultFolder to specialFolderPath("documents")
      put  true into  URL ("file:ScannerInstall.txt")
   end if
end checkScanInstall

///Peter
/*Whats all the fuss with c# ?*/

allengwinn
Posts: 31
Joined: Tue Aug 21, 2012 4:46 pm

Re: MergAVCam for Android

Post by allengwinn » Mon Jan 07, 2019 8:37 pm

Yeah, the only way I could immediately think of it is to possibly put some sort of a file in the media directory. But that would be risky. Your way is better.

allengwinn
Posts: 31
Joined: Tue Aug 21, 2012 4:46 pm

Re: MergAVCam for Android

Post by allengwinn » Mon Jan 07, 2019 8:40 pm

Oh, if you have access to the source, you might be able to confirm that the thing launched successfully. But it would likely have to be done in the external itself. Disclaimer: I've never written an external. Come to think of it, this is my first app in Livecode :)

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4916
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: MergAVCam for Android

Post by jacque » Mon Jan 07, 2019 9:19 pm

Peter@multidesk.se wrote:
Mon Jan 07, 2019 7:04 pm
Yes, Install: https://play.google.com/store/apps/deta ... nt.android
Yes, Copy file AndroidQR.lcext into your projects copy files pane..

Then use:

Code: Select all

 put mergZXingGetBarcode() into tResult
I don't see mergZXing in the inclusions pane, nor in the dictionary. Was it discontinued? Also, so far, I don't see any "merg" externals that are compatible with Android yet. This is a source of dismay to many of us. :(
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

Peter@multidesk.se
Posts: 125
Joined: Fri Oct 14, 2011 6:53 am

Re: MergAVCam for Android

Post by Peter@multidesk.se » Mon Jan 07, 2019 9:51 pm

Jacqueline,

Unfortunately there is no official "merge" barcode external for Android. but this one works pretty well ...


///Peter
/*Whats all the fuss with c# ?*/

allengwinn
Posts: 31
Joined: Tue Aug 21, 2012 4:46 pm

Re: MergAVCam for Android

Post by allengwinn » Mon Jan 07, 2019 10:42 pm

Peter, sorry but do you know if there is some test code that will scan a QR code using mergAVCam as it exists today?

Peter@multidesk.se
Posts: 125
Joined: Fri Oct 14, 2011 6:53 am

Re: MergAVCam for Android

Post by Peter@multidesk.se » Mon Jan 07, 2019 10:46 pm

Have you encountered any problem, what do you need?
/*Whats all the fuss with c# ?*/

allengwinn
Posts: 31
Joined: Tue Aug 21, 2012 4:46 pm

Re: MergAVCam for Android

Post by allengwinn » Mon Jan 07, 2019 10:59 pm

I found some sample code from Monte. I'll try to work it into an iOS app just to see if I can scan a code and make the results pop up on a card somewhere. I'm still at the playing around stage. Now what I'd really like is something cross-platform to do NFC or BLE :)

Peter@multidesk.se
Posts: 125
Joined: Fri Oct 14, 2011 6:53 am

Re: MergAVCam for Android

Post by Peter@multidesk.se » Mon Jan 07, 2019 11:31 pm

Allen,

Here is a simple sample stack with everything you need...
ScanDemo.livecode.zip
(1.84 KiB) Downloaded 24 times

///Peter
/*Whats all the fuss with c# ?*/

mrcoollion
Posts: 381
Joined: Thu Sep 11, 2014 1:49 pm
Location: The Netherlands

Re: MergAVCam for Android

Post by mrcoollion » Thu Jan 10, 2019 1:53 pm

For Android maybe someone can wrap these Android API's for use in LC?

https://developers.google.com/vision/introduction
For Android Barcode Reader this video might be interesting.
https://www.youtube.com/watch?v=amMtAS2 ... kr&index=2

Regards,

Paul

Post Reply

Return to “Android Deployment”