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 "/<mass_storage_location>/Android/data/com.symbol.enterprisebrowser" present on the device. Here <mass_storage_location> 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.

<Applications>

    <Application>

      ....

      <usedwforscanning  value="1"/>

      ....

    <Application>

  <Applications>

      • 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.

<Applications>

    <Application>

      ....

      <IntentReceiver>

        <EnableReceiver  value="1"/>

        <IntentAction  value="com.symbol.dw.action"/>

        <IntentCategory  value=""/>

      </IntentReceiver>

      ....

    <Application>

  <Applications>

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

<General>

<Name value="Menu"/>

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

</General>

                        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.

<html>

<head>

<title>EB Test Page</title>

  <script type="text/javascript" charset="utf-8" src="ebapi-modules.js"></script>

  <script type="text/javascript">

        var outputData = "";

function myIntentListenerCallback(myIntentData){

if((myIntentData != null) && (myIntentData.action == "com.symbol.dw.action")){

var dataWedgeScannedData = myIntentData.data;

outputData = "<BR/> <b>Scanned Data:</b> <BR/>" +

"<BR/> Intent Type:" + myIntentData.intentType + "<BR/>" +

"<BR/> Intent Action:" + myIntentData.action + "<BR/>" +

"<BR/> Decode Source:" + dataWedgeScannedData["com.symbol.datawedge.source"] + "<BR/>" +

"<BR/> Decode Label Type:" + dataWedgeScannedData["com.symbol.datawedge.label_type"] + "<BR/>" +

"<BR/> Decode Data:" + dataWedgeScannedData["com.symbol.datawedge.decode_data"] + "<BR/>" +

"<BR/> Decode Data String:" + dataWedgeScannedData["com.symbol.datawedge.data_string"] + "<BR/>";

var ouptutDiv = document.getElementById("myIntentDataDiv");

ouptutDiv.innerHTML = outputData;

}

}

function startIntentListener()

{

var startListeningDiv = document.getElementById("intentMessageDiv");

startListeningDiv.innerHTML = "Enterprise Browser is listening the DataWedge Intent. <BR/>Scan any data using DataWedge.<BR/><BR/>";

EB.Intent.startListening(myIntentListenerCallback);

}

function registerIntent(){

startIntentListener();

}

  </script>

</head>

<body onload="registerIntent();">

<h1>EB Test Page</h1>

<hr>

<div id="intentMessageDiv"></div>

<div id="myIntentDataDiv"><b>Scanned Data:</b></div>

</body>

</html>

Also attaching the Enterprise Browser Config.xml, TestPage.html and ebapi-modules.js for everyone reference.

 

This is how one can use to get the scanned data inside Enterprise Browser application scanned through DataWedge using Intent.