Get Scanned Data Using DataWedge Inside Enterprise Browser as JavaScript Callback

Abhineet Agarwal -
3 MIN READ
82

The Enterprise Browser application makes it possible to acquire the barcode data as JavaScript callback which is scanned through DataWedge inside Enterprise Browser application on Android platform.

 

This blog explains how to scan and process barcode data using DataWedge inside Enterprise Browser application as JavaScript callback.

 

Follow the below instructions as mentioned below:

  • Configuration at DataWedge end

Note: The below DataWedge configuration is applicable from version 6.0.1 and higher.

  • Configuration at Enterprise Browser end

 

Configuration at DataWedge(v 6.0.1 & higher) end:

  1. Open DataWedge Application. The DataWedge Profiles panel will appear.
  2. Go to DataWedge Settings - From the DataWedge Profiles screen, tap the menu which appears at top right and select Settings. The DataWedge Settings panel will appear.
  3. From the DataWedge Settings panel, tap Disabled app list.
    1. A list appears showing all installed apps and packages where DataWedge is disabled.
    2. Ensure to remove/delete the Enterprise Browser app from the list so that DataWedge is enabled inside Enterprise Browser.
  4. Go back to DataWedge Profiles screen and select the profiles i.e. Profile0 (default).
  5. Profile0 (default) panel will appear. Apply the below settings in this profile:
    1. Ensure Profile enabled field is checked.
    2. Ensure Barcode input – Enabled field is checked.
    3. Scroll down till Intent output field inside Profile0 (default) panel and apply the below settings:
      1. Ensure Intent output – Enabled field is checked.
      2. Set Intent action as com.symbol.dw.action
      3. Set Intent delivery as Broadcast intent

 

Configuration at Enterprise Browser end:

  1. Download and Install Enterprise Browser binary on Zebra Android Device supported by Enterprise Browser application. Enterprise Browser is available here.
  2. Launch Enterprise Browser for extracting Enterprise Browser Config.xml which is used for setting the runtime configuration parameters of Enterprise Browser application.
    • After launch, extract Config.xml from "//Android/data/com.symbol.enterprisebrowser" present on the device. Here refers to "/sdcard" or "/sdcard1" etc., depending on the Zebra Android device used.
  3. Open Config.xml and apply the below settings:
    • Set "usedwforscanning"  tag to 1 in Config.xml. This is used for enabling DataWedge inside Enterprise Browser application. For more details, refer to Enterprise Browser - DataWedge documentation.

   

      ....

     

      ....

   

 

  • Enable the IntentReceiver tags in Config.xml as shown below. For more details, refer to Enterprise Browser - Intent Receiver documentation.
    • Set "EnableReceiver" tag to 1 in Config.xml.
    • Set "IntentAction" value to "com.symbol.dw.action" in Config.xml.

   

      ....

     

       

       

       

     

      ....

   

 

      • Set "StartPage" tag to TestPage.html in Config.xml as shown below.

file://%INSTALLDIR%/TestPage.html" name="Menu"/>

                        Note:

    • In the above example, I am storing TestPage.html inside Enterprise Browser installed directory present in the device.
    • TestPage.html has a logic where scanned data using DataWedge is getting captured through JavaScript callback inside Enterprise Browser application.
    • TestPage.html logic is covered below.

4. Copy updated Enterprise Browser Config.xml to the Enterprise Browser installed directory in the device after all the above mentioned settings are applied.

5. Create TestPage.html as shown below and place the same inside Enterprise Browser installed directory in the device.

Note:

      • ebapi-modules.js is used for accessing the Enterprise Browser JavaScript API's.
      • TestPage.html captures the scanned data as JavaScript callback using Enterprise Browser Intent API.

EB Test Page

 

 

onload="registerIntent();">


EB Test Page





Scanned Data:

profile

Abhineet Agarwal

A smile is a curve that sets everything straight.

Please Register or Login to post a reply

Replies