Angular Start/Stop Scanner

Tags: 

Hello,

I'm starting an Angular project and need to be able to stop the scanner beam on invalid scans. And then restart the beam. A soft scan trigger. I have experience with C# and using the EMDK. But implementing it in Angular is new to me. What is the best route for this? Will I need to use the Datawedge API? Any suggestions or examples would be very helpful!

Darryn Campbell
Hi,

Hi,

You have a couple of options:

Most Angular developers I have seen have opted for the second approach above.

Hope that helps.

Vote: 
Vote up!
Vote down!

Points: 1

You voted ‘up’


Emily Newberry
Thanks for your response

Thanks for your response Darryn. I finally got a device to run some tests on. Using this option... Can we disable the scanner beam when an error occurs on scan? That way the user is forced to look at the display. Then enable the beam once they acknowledge the error. Can you do this with keypress events?

Use DataWedge with keystrokes, please see this post: https://developer.zebra.com/blog/listening-keypress-events-datawedge

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Darryn Campbell
How are you deploying your

How are you deploying your Angular project?  I ask because to disable the scanner beam you would need to communicate with the scanner either through the DataWedge Intent API or EMDK. If you are wrapping Angular in something that underestands Intents, such as Cordova, you could use the Intent API but if you are just running it in the Chrome browser then there would not be any way for you to communicate with the scanner.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Emily Newberry
Darryn,

Darryn,
So the Angular project would be hosted on a server and integrate with some other pages. It sounds like if we just want to accept a scan we would use the ASCII path to do the carriage return to accept the scan. But if we want to utilize the scanner more (controlling scanner beam) we would need access to the EMDK via Enterprise browser. Or go the Cordova route and use Intent API. Is that correct? Like I said before I have done previous development in C# and used the EMDK. I like to be able to utilize the scanner to its full capabilities and have control of the hardware itself.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Darryn Campbell
That's exactly correct.  More

That's exactly correct.  More information about calling the scanner from a cordova app is at https://developer.zebra.com/community/home/blog/2016/08/04/integrating-d....  

I guess another option would be to write a Xamarin app in C# with a webview, render your Angular app in that webview and control the scanner via native C# code, but that would probably be the most work to achieve.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Emily Newberry
Got it!! Thanks so much for

Got it!! Thanks so much for the information! I think I know the route we need to take!

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Log in to post comments