Let's follow up this discussion at the Neptune Community

(this forum will be kept in read-only mode)

Zebra Barcode-Scanner with Neptune Application

Hello,

we are using the Zebra TC8000 and want to delevop an App, which can use the Barcode-Laserscanner without an Inputfield. This is necessary for more comfort and faster processes.


Do you have any idea how I can react to the event when the hardware trigger Button is pressing? I found a lot of information at Zebra itself (http://techdocs.zebra.com/enterprise-browser/1-5/tutorial/barcode/), but here I need the Enterprise Explorer what isn't a the solution for us, because we need a normal Neptune App.


I also tried just to include the required modules (http://techdocs.zebra.com/enterprise-browser/1-5/api/barcode/) but I get an error which comes from the js-file


Error: Unexpected token o in JSON at position 1(…)


Kind Regards

Benjamin Bennicke


Hi Benjamin


To use the Hardware specific scanners on Zebra Android devices. Requirement: The Datawedge App must be installed on the Device.

 

Enable the Datawedge pluging by adding the following to the config.xml file - in NAM custom config.xml

 

<plugin name="motorola-datawedge-cordova-plugin" source="npm"/>

<platform name="android">

  <preference name="AndroidLaunchMode" value="singleTop" />

</platform>

 

Add the event listener in your App. Can be added to you init script:


 

document.addEventListener("deviceready", function() {

        if (window.datawedge) {

            datawedge.start(); //uses default

            datawedge.registerForBarcode(function(data) {

                    var labelType = data.type,
                        barcode = data.barcode;

                    //sap.m.MessageToast.show("Barcode scanned.  Label type is: " + labelType + ", " + barcode);
                    // Do your stuff with the scanned barcode here!!!
                }
            );
        }
});

 

 

Set up a Datawedge profile 

  • Associate your App to the profile 
  • Enable intent output 
  • Set Intent action to “com.bluefletch.motorola.datawedge.ACTION 
  • Set Intent delivery to “Broadcast intent” 
  • Intent category must be left empty



Regards

Ole Andre 


2 people like this

Hello Ole Andre,


fantastic! It works great :)


Regards

Benjamin

Hello Ole Andre,


is it possible to react to the event, when I'm pressing any key? In my case I want to capture the event for the key under the Barcode Laser Trigger.


KR
Benjamin

Can this be runned in Neptune Client ? or do it needs to be compiled in PhoneGap ?


Brgds

Henrik

Login or Signup to post a comment