RFID Web App On Android Using RhoElements

We have a web application that makes use of the RhoElements library using JavaScript. Currently this application is running on older Windows CE devices, using Enterprise Browser. Recently, we have moved to the Android based devices (MC3300R). We would like to connect to the same web applications, but they do not seem to function at all. I know, for the Windows devices, that we had to copy over the file "WTG_RFID_PLG.dll" to the device. I assume a similar step would be required on Android, but I am unable to find any instructions for how to accomplish this. The documentation for the RhoElements does state that it works with Android.

Does anyone know the steps to get these applications working again?

Darryn Campbell
Hi, so the Android API you

Hi, so the Android API you are looking for is https://techdocs.zebra.com/enterprise-browser/2-5/api/re2x/rfid/.  The team tried to match the API as closely as possible to the previous WTG_RFID_PLUG API.  From Enterprise Browser 2.0 you no longer need a separate download for RFID.

I also have this code sample from a presentation I delivered a while back:

// RFID
rfid.enumRfidEvent = "EnumRfid(%s);";
rfid.enumerate();
function EnumRfid(rfidArray)
{
    rfid = rfidArray[0][0];
    rfid.connect();
    rfid.tagEvent = "TagHandler(%json)";
    rfid.performInventory();
}
function TagHandler(tagArray)
{
    for (i = 0; i < tagArray.TagData.length; i++)
        document.activeElement.value = tagarray.TagData[i].TagID;
}

I don't have any hardware to check whether the above works I'm afraid but this was my understanding based on communication from the development team following EB 2.0's release.

 

Vote: 
Vote up!
Vote down!

Points: 1

You voted ‘up’


Brandon Brock
Thanks for the reply. I did

Thanks for the reply. I did find that API and it looks like it should match up with what is on these pages. However, when I add some debug lines into the code I see that the first time it tries to call a function, such as rfid.connect(), the code will stop functioning at that point. This is the behavior that is exhibited when that library did not exist in the Windows CE devices. Here is a sample of the first few lines of code just to show where it fails. In this case, it never logs "Test 2" as it seems to fail after the first rfid call.

$(function() {
debug = true;
if(debug) ets.debug.log('Starting Script');
InitializeRFID();
if(debug) ets.debug.log('After Initialize');
});

function InitializeRFID()
{
if(debug) ets.debug.log('Initializing');

document.getElementById("StatusMessageID").innerHTML = "Press the Trigger";

if(debug) ets.debug.log('Test 1');
rfid.statusEvent = 'onStatus(%json)';
if(debug) ets.debug.log('Test 2');
rfid.tagEvent = 'tagEvent(%json)';
rfid.radioPowerStateEvent = 'radioPowerStateEvent(%json)';
rfid.enumRFIDEvent = 'enumRFIDEvent(%json)';

if(sessionStorage.enumObj == undefined)
{
rfid.connect();
rfid.enumerate();
}
….
}

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Darryn Campbell
Please try with:

Please try with:

  <InjectEBLibraries>
    <JSLibraries value="1"/>
  </InjectEBLibraries>

In Config.xml.  More information is available from https://techdocs.zebra.com/enterprise-browser/2-5/guide/configreference/

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Brandon Brock
I tried that change already,

I tried that change already, but it seemed to behave the same. I also tried to add the files to the insert tag file and point to that .js file. That did not seem to work either.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Brandon Brock
I did some more testing after

I did some more testing after reinstalling EB 2.0, with the change to the config.xml file as you mentioned. I still see the following in the EB Log.txt file:

I 03/24/2020 12:25:31:468 00003fc6 RhoWebChromeClient| Uncaught ReferenceError: rfid is not defined

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Darryn Campbell
Can you try with the latest

Can you try with the latest EB 2.5 release?  Before I answered last week I was able to observe the rfid object using Chrome://inspect but I was using the latest version of EB.  https://www.zebra.com/us/en/support-downloads/software/developer-tools/enterprise-browser.html

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Brandon Brock
I tried with EB 2.5 first. I

I tried with EB 2.5 first. I uninstalled that and tried with 2.0 yesterday, just to make sure. It is almost like it is not injecting the JS libraries as it seems like it should be.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Norma Vasquez
app development

If you need any help in app development, check https://chisw.com/tech-interest. The company is specialized in app development. I've been using their services for almost 5 months already.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Log in to post comments