-1

We need to run the EB.barcode function from another application. To test this, we built the tutorial provided by Zebra, barcode.html, which references ebapi-modules.js. We put this in a folder called ZebraScanner – just those two files.

When this folder is placed in the /Android/data/com.symbol.enterprisebrowser folder – and the Config.xml file is modified to set barcode.html as the start page – it works perfectly.

When this folder is placed in the /Download folder .. this popup appears:

{"method":"getDefaultID","params":
[],"_rhoClass":"Rho.Barcode","_rhoID
":"0","jsonrpc":"2.0","id":1}

_rhoNativeApiCall:prompt
Delphi Coder
  • 1,723
  • 1
  • 14
  • 25
ShaneWood
  • 1
  • 1

1 Answers1

0

You can only run the EB.Barcode function from within Zebra's Enterprise Browser. The webview exposed by that product exposes several addJavaScriptInterface calls that are required to execute the logic in ebapi-modules.js, hence why you are seeing that error. If you are trying to scan from within another browser such as Chrome or FireFox then a good approach is to use DataWedge with KeyPress & there is an article explaining how to do that at https://developer.zebra.com/blog/listening-keypress-events-datawedge

Darryn Campbell
  • 1,441
  • 10
  • 13
  • Darryn, the entire goal here is to control the scanner from our Android application. I need to be able to turn the scanner off when an error is presented, and add a short delay after each good scan, so I dont overload the software. Is this possible? – ShaneWood Sep 18 '20 at 14:09
  • From a native Android app? You mentioned EB so I assumed you were developing a web app. You have full control of the scanner through DataWedge, I have a getting started tutorial for that: https://medium.com/@darryncampbell_83863/getting-started-with-datawedge-on-zebra-devices-9af2cdd1110c you can turn the scanner off via the DataWedge API in a similar way to how the tutorial uses the API to mimic the hardware trigger. – Darryn Campbell Sep 21 '20 at 06:35