I am building an app for android and ios using Ionic.Can anyone guide me how to write custom plugin for a usb barcode scanner for android platform?


#1

I am building an app for android and ios using Ionic.Can anyone guide me how to write custom plugin for a usb barcode scanner for android platform?I am using a infrared usb scanner,and I have build an app for android with that scanning and returning a string in a textview.Now I need to write a plugin in cordova so that I get the scanned code in success call back…


#2

You can scan barcodes using your ionic app - why do you need an external barcode scanner and deal with USB?


#3

As per requirement we are not supposed to use barcode scanner using camera which is there in ionic.we have one usb scanner and bluetooth scanner which I have used in the ionic app by writing custom plugins…


#4

i would you be able share what plugin you wrote for bluetooth scanner


#5

Have you got the solution? I have the same problem.


#6

I wrote a custom plugin and the scanner itself has an android sdk,which was exposing method to returned the scanned code so my plugin basically wrote a javascript method to get the scanned code from android native part.


#7

Can you post a sample of your custom plugin explaining how to transfer data from native to JavaScript


#8

Is there any GitHub link? If any can you please share the link?

Thanks in advance :slight_smile:


#9

Hi Umesh,
Due to company policy,I cannot share you the link but
will share snippets of the code,hope it helps.


#10

Yes, it will work. Please share the snippets of the code.

Thank you for your help.