13 Replies Latest reply on Dec 9, 2016 1:39 PM by Gord Davey

    EB1.4 on TC8000 - Proximity Sensor

    Gord Davey

      All,

       

      With EB1.4 on a TC8000, I'm having trouble turning on the proximity sensor via JavaScript. I see that that turning it on in the settings and using DataWedge it appears to work fine.

       

      But when using JavaScript and the EB object, I've been unsuccessful trying to turn the sensor on.

       

      Can anyone share their code to get the proximity sensor turned on please ?

       

      Thank you very much.

       

      Gord.

        • Re: EB1.4 on TC8000 - Proximity Sensor
          Gord Davey

          Bump.

          I really need to know about the proximity sensor please.

          When I turn on hands-free scanning in settings, the proximity sensor works, but as soon as I start the Enterprise Browser (1.4) is quits working, and I can find nothing in the API that works to turn the Proximity sensor on.

          Thank you.

          • Re: EB1.4 on TC8000 - Proximity Sensor
            ABHINEET AGARWAL

            Dear Gord,

             

            Please let us know the below things:

            1. Which Enterprsie Browser API are you using for turning on the proximity sensor?

            2. Is it running on TC8000 KK or above platform?

             

            Please note:

            You can set the proximity sensor using EnterpriseBrowser RE 2.x RawSensors API as mentioned below:

            Syntax: Add the below syntax to the html page which enables the proximity sensor data retrieval.

                 RawSensors.proximity = 'Enabled';

            Note:

            In the html page, the above syntax will work if and only if "elements.js" is included to the page.

            "elements.js" file is present under "C:\EnterpriseBrowser\JavaScriptFiles\BackwardCompatibility\Android" if EnterpriseBrowser MSI is installed under "C:/" drive on Windows PC.

             

            Thanks & Regards,

            Abhineet

              • Re: EB1.4 on TC8000 - Proximity Sensor
                Gord Davey

                Abhineet,

                 

                Re #1 - I am using Enterprise Browser 1.4

                 

                Re #2 - I am using a TC8000 with KitKat

                 

                A) I've just tried your suggestion of using "elements.js"

                 

                     Both with the JavaScript:

                 

                     In the page

                 

                     This also has no effect in turning the sensor on.

                 

                D) I've tried all possibilities I can think of using the EB 1.4 API, as

                well as the rhoapi-modules.js commands for the proximity sensor, and now

                the elements.js and still nothing is turning it on.

                 

                E) My TC8000 does have the proximity sensor in it. If I turn the sensor

                on in the Android Settings, then the sensor functions just fine until I

                start the Enterprise browser. Then it is off, and I cannot get it to

                turn back on.

                 

                Gord Davey <Gord.Davey@DaveyComputing.com>

                    President - Gord Davey Computing - www.DaveyComputing.com

                    Rockwood ON Canada. Tel: +1 (519) 835-4322

                       - High Tech Resources For All Your Computing Needs.

                       - Custom Programming, Consulting, OS, Networking, Support &

                Administration.

                       - PVX Plus, ProvideX and more.

                  • Re: EB1.4 on TC8000 - Proximity Sensor
                    ABHINEET AGARWAL

                    Dear Gord,

                     

                    We have validated Proximity Sensor API from EB application and it is working fine from EB application.

                     

                    Sample HTML Page:

                    <html>

                    <head>

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

                    <script type="text/javascript" >

                      var sensorInstance;

                      function proximitySernsordata()

                      {

                           sensorInstance = EB.Sensor.makeSensorByType(EB.Sensor.SENSOR_TYPE_PROXIMITY);

                           if(sensorInstance)

                           {

                                sensorInstance.start(callbackData);

                           }

                           else

                           {

                                outputDiv.innerHTML = "Proximity Sensor is not supported.";

                           }

                      }

                      //Do whatever when proximity sensor associated callback is fired.

                      function callbackData(data)

                      {

                            var proximitySensorData = "<B>Proximity Sensor Data:</B>";

                            proximitySensorData = proximitySensorData + JSON.stringify(data.proximity_value) +"<BR>";

                            outputDiv.innerHTML = proximitySensorData;

                     

                            //Here one can enable the soft scanner if they want using below syntax. Currently i have commented the same..

                            //EB.Barcode.enable();

                            //EB.Barcode.start();

                      }

                    </script>

                    </head>

                    <body onload="proximitySernsordata()">

                           <h2>Welcome to Enterprise Browser - EB 1.X Proximity Sensor Sample Page</h2>

                           <div id="outputDiv"></div>

                    </body>

                    </html>

                     

                    Please note:

                    1. User need to ensure to include ebapi-modules.js file, if EB 1.X API is used in the html page
                    2. User can do whatever when EB Proximity Sensor callback is fired.
                    3. DataWedge application should be turned off if Barcode Scanner is going to be enabled from EB application

                             DataWedge Profiles --> Settings --> DataWedge Settings --> UnCheck the DataWedge enabled

                       4. From settings, under Hands Free Scanning, the  Scanning Mode should be changed to Hands Free Off option.

                              Setting --> Hands Free Scanning --> Scanning Mode --> Hands Free Off

                     

                    Attaching the sample page for your reference which is availabe at zebra box link: ProximitySensor - Box 

                    The zip file consists the below files:-

                    1. EB1.X_ProximitySensorCommonAPI.html
                    2. ebapi-modules.js

                     

                    Please raise a ticket and our team will assist you further, If it doesn't work with the above mentioned steps.

                    • Re: EB1.4 on TC8000 - Proximity Sensor
                      Edward Correia

                      Hi Gord-

                       

                      Did Abhineet's answer help you? Please let us know if you require further assistance.

                       

                      Regards,

                      Eddie Correia

                        • Re: EB1.4 on TC8000 - Proximity Sensor
                          Gord Davey

                          Edward and Abhineet,

                           

                          Sorry I haven't had a chance to get to test this solution, I was pulled

                          off onto a side project, and need to complete it before getting back to

                          the proximity sensor, I will check it soon, thank you for the detail on

                          how to do it, I would not have figured that sequence out on my own with

                          the existing documentation.

                           

                          Gord Davey <Gord.Davey@DaveyComputing.com>

                              President - Gord Davey Computing - www.DaveyComputing.com

                              Rockwood ON Canada. Tel: +1 (519) 835-4322

                                 - High Tech Resources For All Your Computing Needs.

                                 - Custom Programming, Consulting, OS, Networking, Support &

                          Administration.

                                 - PVX Plus, ProvideX and more.

                            • Re: EB1.4 on TC8000 - Proximity Sensor
                              ABHINEET AGARWAL

                              Dear Gord,

                               

                              We found out the root cause of this issue that WHY it worked at our end but not at your end.

                               

                              On investigation, we found out that the value of Sensor.TYPE_PROXIMITY(used internally by EnterpriseBrowser ) has been changed recently on TC8000 BSP.

                               

                              That is why the sensor instance was always returning null as EnterpriseBrowser was trying to get the sensor instance with the old value of Sensor.TYPE_PROXIMITY.

                               

                              But the latest upgraded TC8000 BSP was expecting different value for getting the sensor instance. We have already addressed this to TC8000 BSP team to update the right value to Sensor.TYPE_PROXIMITY.

                               

                              As you have already raised support ticket, our team will provide you solution through support site.

                               

                              Thanks & Regards,

                              Abhineet Agarwal

                              Enterprise Browser Software Lead