Pure javascript API to read scans

I am developing a proof of concept to use a Progressive Web App (PWA) on a Datalogic Android device. I happen to have a Memor 20 for development purposes, though I will also get to play with a Skorpio X5 beta soon. I have managed to get the PWA installed on the device’s home screen.

I would like to access the handheld scanner from my PWA. Is there a pure javascript API available to read scans? The APIs I see on github seem to require some kind of native Android component. I know PWAs have access to Bluetooth and USB devices in Chrome. It would be great if I could access the scanner via some kind of javascript library.

The only solution I see right now is using HTTP requests to the DXU HTTP API (as mentioned by Donato_Cataldo). I was able to get the result of a scan in Chrome via a localhost URL, so I assume I can use this from a PWA, too. I am mildly concerned about opening a permanent HTTP request to look for scans, but maybe it would work.

(I also have a Chrome security issue with a self-signed dev certificate that is preventing installing the service worker correctly, but that is outside the scope of this request.)

Hi @Paul_Williams ,

Today we do not have any javascript API available to read scans. If you just need to get the barcode in a field on a page, the Keyboard Wedge could be a solution.

Best Regards

Good day

Do we have any progress on this after 2 years?

I see an option called “Web Wedge” in the settings which is supposed to call an URL, but this does exactly nothing on our Memor 1 and Memor 10 devices.

We are trying to develop a reliable PWA without having to use the keyboard wedge mode of our scanners. :slight_smile:

Hello there. I’m using VueJS Javascript framework. I was wondering is it possible to get value from scanner without input? Im running webapp on Datalogic Memor20. Thank you in advance

Hi @Jef_Kalashnikov,
the option “Web Wedge”, as reported from the manual, “Enables direct data input into internet browsing applications, in the form of a valid URL”, this means that if you enable the option and read a barcode that contains a valid URL, for example www.datalogic.com, the browser will be automatically open and you will be redirect to the URL.

At the moment we don’t have Javascript API, if there are updates they will follow on this post.

close to JS , you have React Native and Dlatalogic has a solution React Native SDK | Technical Documentation
here by us, we can do that if requested.

Datalogic React Native SDK allows developing mobile applications in Javascript using the React paradigm, but those app will look as native and standalone applications, while it will not be possible to run them as standard web pages inside a standard web broswer.
For that purpose a Datalogic custom WebBrowser supporting a specific Javascript SDK would be required, which unfortunately is not available today. If there are updates they will follow on this post.

Simone Callegari
Datalogic Mobile Products Specialist - SW Engineer