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

 

This blog explains how to capture and process SimulScan data using DataWedge inside Enterprise Browser application as JavaScript callback. SimulScan facilitates the user to quickly capture large amounts of data. This post outlines how to easily leverage DataWedge to pull that data into an application built with Enterprise Browser.

 

SimulScan Overview

The SimulScan option present inside DataWedge application allows simultaneous capture of barcodes, images, text, signatures, phone numbers and other data from a scan target in a single pass. A SimulScan Input option adds this capability to DataWedge. When form data is captured according to a designated SimulScan template, data can be processed or formatted as required using Process Plug-ins. For more information, refer to the SimulScan User Guide. This feature can be used only on the device that supports SimulScan. List of supported devices is shared here.

 

Follow the below instructions as mentioned below:

1. Configuration at DataWedge end

Note: The below DataWedge configuration is applicable to version 6.2 and higher.

2. Configuration at Enterprise Browser end

 

Configuration at DataWedge(v 6.2 & higher) end:

Enable DataWedge Inside Enterprise Browser Application:

  • Open DataWedge Application. The DataWedge Profiles panel will appear.
  • Go to DataWedge Settings - From the DataWedge Profiles screen, tap the menu which appears at the top right and select Settings. The DataWedge Settings panel will appear.
  • 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.

Note: Above step by step configuration is also shown in the below screenshot

Enable_DataWedge_Within_EB.png

Enable SimulScan Input Inside DataWedge Profile:

First, push the attached POSTAL.xml to /enterprise/device/settings/datawedge/templates on Zebra supported Android device. User can push the same using the below adb command.

adb push <template_path_on_local_machine> /enterprise/device/settings/datawedge/templates

Also, take the printout of the attached Postal.jpg for capturing at the later stage. The POSTAL.xml is generated using Postal.jpg image.

The user can generate the custom template for any document by referring to Zebra's SimulScan Template Builder.

 

  • Now, Goto DataWedge Profiles screen and select the profiles i.e. Profile0 (default).
  • Profile0 (default) panel will appear. Apply the below settings in this profile:
    1. Ensure Profile enabled field is checked.
    2. Ensure SimulScan input – Enabled field is checked.
    3. Select Device selection as Camera.
    4. Select Template Selection as - POSTAL.xml.
      • You can choose any template based on your choice.

Note:

    • Above step by step configuration for Profile Selection and enabling SimulScan input is also shown in the below screenshot.

Profile.png

    • Device Selection - permits selection between the device camera and the default scanning device set by the system (recommended).
    • Template selection - sets a SimulScan template for the Profile being configured.
    • Refer here for further details on SimulScan DataWedge option.
    • SimulScan is free for many scanning scenarios when used with DataWedge and its default Templates to scan only barcodes and/or for certain types of OCR acquisition. A per-device license is required for advanced SimulScan features. For licensing details, please see the Licensing guide.

 

Configure & Enable Sending Of Captured SimulScan Data Using Intent:

  • 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.dwss.action
    3. Set Intent delivery as Broadcast intent

Note: Above step by step configuration is also shown in the below screenshot.

Intent_Profile.png

 

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.dwss.action in Config.xml.

<Applications>

<Application>

....

<IntentReceiver>

<EnableReceiver value="1"/>

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

<IntentCategory value=""/>

</IntentReceiver>

....

<Application>

<Applications>

    • Set StartPage tag to SimulScanTestPage.html in Config.xml as shown below:

<General>

<Name value="Menu"/>

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

</General>

Note:

      • In the above example, I am storing SimulScanTestPage.html inside Enterprise Browser installed directory present in the device.
      • SimulScanTestPage.html has a logic where SimulScan data captured using DataWedge application gets received inside Enterprise Browser application as a JavaScript callback.
      • SimulScanTestPage.html logic is covered below.

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

5. Create SimulScanTestPage.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.
      • SimulScanTestPage.html receives the SimulScan data as JavaScript callback using Enterprise Browser Intent API.

<html>

<head>

<title>Enterprise Browser SimulScan Test Page</title>

<style>

table, th, td {

border: 1px solid black;

}

th {

    background-color: #eeeeee;

    color: black;    

}

</style>

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

<script type="text/javascript">

var simulScanData = "";

function myIntentListenerCallback(myIntentData){

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

       simulScanData = myIntentData;

var dwSSData = myIntentData.data;

 

var outputData = "<u><b>"+

  dwSSData["com.symbol.datawedge.simulscan_template_name"] + " Template SimulScan Data:</b></u>" +

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

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

  "<BR/> <b>Source:</b> " + dwSSData["com.symbol.datawedge.source"] +

  "<BR/> <b>Template Name:</b> " + dwSSData["com.symbol.datawedge.simulscan_template_name"] +

  "<BR/> <b>Data:</b> " + dwSSData["com.symbol.datawedge.data_string"] +

  "<BR/> <b>Dispatch Time:</b> " + dwSSData["com.symbol.datawedge.data_dispatch_time"];

 

 

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

ouptutDiv.innerHTML = outputData;

 

 

var dwSSPkg = "com.symbol.datawedge.simulscan_region_";

if(dwSSData[dwSSPkg + "data"].length){

var tableOutputData = "<tr><th>ID</th><th>Name</th><th>Type(s)</th><th>Data</th></tr>";

 

for(index = 0; index < dwSSData[dwSSPkg + "data"].length; index++){

 

  tableOutputData += "<tr><td>" + dwSSData[dwSSPkg + "data"][index][dwSSPkg + "id"]  + "</td><td>" +

  dwSSData[dwSSPkg + "data"][index][dwSSPkg + "name"] + "</td><td>" +

  dwSSData[dwSSPkg + "data"][index][dwSSPkg + "type"] + "</td><td>";  

 

  if(dwSSData[dwSSPkg + "data"][index][dwSSPkg + "type"] == "picture"){  

  tableOutputData += dwSSData[dwSSPkg + "data"][index][dwSSPkg + "binary_data"];

  }else{

  tableOutputData += dwSSData[dwSSPkg + "data"][index][dwSSPkg + "string_data"];

  }  

  tableOutputData += "</td></tr>";

}

}

 

var tableData = document.getElementById('tableSimulScanData');

tableData.innerHTML = tableOutputData;

}

}

function startIntentListener(){

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

startListeningDiv.innerHTML = "Enterprise Browser is listening the DataWedge Intent. " +

  "Start SimulScan by pressing H/W Trigger.";

EB.Intent.startListening(myIntentListenerCallback);

}

function registerIntent(){

startIntentListener();

}

</script>

</head>

<body onload="registerIntent();">

<h1>Enterprise Browser SimulScan Test Page</h1>

<hr/>

<div id='intentMessageDiv'></div>

<hr/>

<table id='tableSimulScanData'></table>

<hr/>

</body>

</html>

Note:

In the above HTML content, every time when SimulScan data is successfully captured using DataWedge, the below thing happens inside Enterprise Browser application.

  • The data is received at Enterprise browser application inside the registered callback i.e. myIntentListenerCallback. The callback was registered using Enterprise Browser Intent API i.e. EB.Intent.startListening(myIntentListenerCallback).
  • myIntentData is myIntentListenerCallback argument which consists of SimulScan data captured using DataWedge. The argument holds the below data:

EB_SimulScan_Data_Content.png

 

  • On using the above HTML page and configuring all that is mentioned above then the received data on scanning the below POSTAL(i) document looks something like mentioned in the below Enterprise Browser Window (ii).

Postal.jpg

Postal Template Image

EB_SimulScan_Test_Page_Latest_Image.png

(ii) Captured SimulScan Data Inside Enterprise Browser Application

 

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

 

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