13 Replies Latest reply on May 5, 2014 4:35 AM by Dan Silva

    how to add system.barcode.reader to web.config

    Faisal Kummangottu

      dear all

       

      i have a MK500 device which will read barcode and display the price from SQL database using .NET windows CE mobile application

       

      now one of the client need web based instead of native application.

       

      i made a .aspx web site for reading barcode entered on the text box and display price. - this is also working fine from browser of MK500.

      now i need to open the reader/scanner on  the device while the .aspx opens and read the barcode to aspx page from the reader/scanner

       

      i copied the dll files (symbol.dll, symbol.barcode.dll,symbol.standardforms.dll) to web site bin folder.

       

      now i am getting below error while running the default.aspx page (both from device and desktop)

       

      Could not load file or assembly 'Microsoft.WindowsCE.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=969db8053d3322ac, Retargetable=Yes' or one of its dependencies. The system cannot find the file specified.


      please advice

      Faisal

        • Re: how to add system.barcode.reader to web.config
          Dan Silva

          Those dlls are CE code, they will not run on your web server. 

           

          The MK500 comes preloaded and prelicensed with our PocketBrowser, which gives you the ability to access the scanner using meta tags and/or JavaScript from your web app (you do not need or want those dlls).

           

          Take a look on the support site and download the relevant version of PocketBrowser to your PC so you will have the help file so you can see how to use it. I think it was a 2.X version on the MK5, but it's been a while.

          https://portal.motorolasolutions.com/Support/US-EN/Search?searchType=simple&searchTerm=pocketbrowser

          I will paste in below some code I have used to show how this can work on an MK500.  If you point pocketbrowser to this page on your webserver, you should see the scanner working.

           

          <HTML>

          <HEAD>

          <META HTTP-Equiv="all_decoders" Content="disabled">

          <META HTTP-Equiv="upce0" Content="enabled">

          <META HTTP-Equiv="upca" Content="enabled">

          <META HTTP-Equiv="upce0-ConvertToupca" Content="true">

          <META HTTP-Equiv="ean8" Content="enabled">

          <META HTTP-Equiv="ean13" Content="enabled">

          <META HTTP-Equiv="ean8-ConvertToEAN13" Content="true">

          <Meta http-equiv="scanner" content="AIM_TYPE_PRESENTATION">

          <Meta http-equiv="scannernavigate" content="Javascript:doScan('%s');">

          <Meta http-equiv="scanner" content="enabled">

           

           

          </HEAD>

          <BODY onLoad="doSoftScan();">

            <SCRIPT LANGAUGE="JavaScript">

              var Generic = new ActiveXObject("SymbolBrowser.Generic");

           

           

              function doSoftScan()

              {

               Generic.InvokeMetaFunction('scanner', 'start');

              }

           

           

              function doScan(data)

              {

               bcode.innerHTML = data;

               doSoftScan();

             }

            </SCRIPT>

            <div id="bcode"></div>

          </BODY>

          </HTML>

            • Re: how to add system.barcode.reader to web.config
              Faisal Kummangottu

              Dear Dan

               

               

               

              Yes pocket browser is there in mk500 device, I can see it.

               

               

               

              My question is , do we need to install pocketbrowser on the PC(web server) also ? or just use the javascript code you sent on to my default.aspx, so that scanner light will become red.

               

               

               

              Please advice

               

              Faisal

                • Re: how to add system.barcode.reader to web.config
                  Dan Silva

                  You don't need to install anything special on your webserver.  The sample page I provided should be enough to get the scanner working for you. 

                    • Re: how to add system.barcode.reader to web.config
                      Faisal Kummangottu

                      Dear Sir

                       

                       

                       

                      I added the code same as you given,

                       

                       

                       

                      It loads the page, and calling the function dosoftscan() as well, but the scanner light is not active.

                       

                       

                       

                      The code is below

                       

                       

                       

                      Kindly check

                       

                       

                       

                            

                       
































                      function fn1() {



                      if (event.keyCode == 13) {


                      document.Form1.btnSubmit.click(); return false;


                      }


                      }


                      function fn2() {



                      document.Form1.btnSubmit.click(); return false;


                      }



                      var Generic = new ActiveXObject("SymbolBrowser.Generic");




                      function doSoftScan() {


                      alert('dfdfd');


                      Generic.InvokeMetaFunction('scanner', 'start');


                      }




                      function doScan(data) {


                      bcode.innerHTML = data;


                      doSoftScan();


                      }


















































                       

                      6291056180004AL AIN APPLE JUICE 1.8LTالعين عصير التفاح 1.8لتر8.2525 Mar 2014

                        • Re: how to add system.barcode.reader to web.config
                          Dan Silva

                          The meta tags at the top of the page are important.  These would enable the scanner, which must happen before you call doSoftScan().  You could also do this via JavaScript, but the scanner must be enabled, and it also must be in presentation mode.  The last 3 meta tags shown would be the minimum needed.

                           

                          Take a look in \application\SymbolPB on the device.  I think you will find a demo page in there (spb21.html) that should work if you point pocketbrowser to it (that would be where it was pointed out of the box).  If that works, grab that file and use it as a template.

                           

                          If you have those and it is still not working, I think the name of the generic object changed between versions of PocketBrowser.  I think it was in version 3 we changed it from SymbolBrowser to PocketBrowser, so maybe try this both ways, but unless you have updated PocketBrowser on the unit, I think it would have V2 on it.

                           

                          var Generic = new ActiveXObject("SymbolBrowser.Generic");

                          or if you are running V3

                          var Generic = new ActiveXObject("PocketBrowser.Generic");

                            • Re: how to add system.barcode.reader to web.config
                              Faisal Kummangottu

                              Dear sir

                               

                               

                               

                              I even copied the SPB21.html to my web site and tried to browse the page from MK3000 device.

                               

                               

                               

                              It responds to the start, stop buttons (I appened alert(“blah”) within those javascript functions and it works)

                               

                               

                               

                              I also goes to the APPLICATION\SYMBOLPB FOLDER AND OPEN THE PAGE SPB21.html, still scanner is not enables.

                               

                               

                               

                              I tried changing the code Symbolbrowser to pocketbrowser but still same.

                               

                               

                               

                              But when I open pocketbrowser 3.0 application, I am getting a similar screen like spb21.html , and when pocketbrowser opened, the scanner light is getting enabled

                               

                               

                               

                              Below is the code source for sbp21.html

                               

                               

                               


























                                     var IsImager         = true;

                               

                                     var scanTimer        = null;              // Scan timer

                               

                               

                               

                                     var KEY_SOFT1       = 0x28;

                               

                                     var KEY_SOFT2       = 0x0D;

                               

                                     var KEY_SOFT3       = 0x26;

                               

                                      

                               

                                     var genObj = new ActiveXObject("SymbolBrowser.Generic");

                               

                                      

                               

                               

                               

                                     function SetIsImager()

                               

                                     {

                               

                                            var HKEY_LOCAL_MACHINE = 2;

                               

                                            var strData = "";

                               

                               

                               

                                            strData = genObj.GetRegistrySetting(HKEY_LOCAL_MACHINE,  "Drivers
                              BuiltIn
                              BarCodeReader",  "FriendlyName");

                               

                               

                               

                                            if ( strData.indexOf("1D") !=  -1 )

                               

                                                   IsImager = false;

                               

                                            else

                               

                                                   IsImager = true;

                               

                                     }

                               

                                      

                               

                                     function doLoad()

                               

                                     {

                               

                                            genObj.InvokeMETAFunction('scanner', 'AIM_TYPE_TRIGGER');

                               

                               

                               

                              //            genObj.InvokeMETAFunction('battery', 'show');

                               

                              //            genObj.InvokeMETAFunction('signal', 'show');

                               

                                            stopScanner();

                               

                                     }

                               

                                      

                               

                                     function doQuit()

                               

                                     {

                               

                                            genObj.InvokeMETAFunction('application', 'quit');

                               

                                     }

                               

                                      

                               

                                      

                               

                                     function flashSoftKey(keyEl)     

                               

                                     {

                               

                                                   keyEl.style.backgroundColor = 'white';

                               

                                                   keyEl.style.color = '#438EB9';

                               

                                                   setTimeout(function(){keyEl.style.backgroundColor = '#438EB9';}, 250);

                               

                                     }

                               

                                      

                               

                                     function startScanner()

                               

                                     {

                               

                                            skey1.style.color = '#1E78AD';

                               

                                            skey1.style.borderColor = '#438EB9';    

                               

                                            skey2.style.color = 'white';

                               

                                            skey2.style.borderColor = 'white';

                               

                                             

                               

                                            genObj.InvokeMETAFunction('scanner', 'start');

                               

                                     }

                               

                                      

                               

                                     function stopScanner()

                               

                                     {

                               

                                            if ( scanTimer != null )                 // Kill the scan timer if it's running

                               

                                            {

                               

                                                   clearTimeout(scanTimer);

                               

                                                   scanTimer = null;

                               

                                            }

                               

                                             

                               

                                            skey2.style.color = '#1E78AD';

                               

                                            skey2.style.borderColor = '#438EB9';    

                               

                                            skey1.style.color = 'white';

                               

                                            skey1.style.borderColor = 'white';

                               

                                             

                               

                                            genObj.InvokeMETAFunction('scanner', 'stop');

                               

                                             

                               

                                     }

                               

                                      

                               

                                     function doKeys(key)

                               

                                     {

                               

                               

                               

                                            if(key == KEY_SOFT1)

                               

                                            {

                               

                                                         if(document.getElementById('skey1').style.color == 'white')

                               

                                                         {

                               

                                                                flashSoftKey(document.getElementById('skey1'));

                               

                                                                startScanner();

                               

                                                         }

                               

                                            }

                               

                                            else if(key == KEY_SOFT2)

                               

                                            {

                               

                                                         if(document.getElementById('skey2').style.color == 'white')

                               

                                                         {

                               

                                                                flashSoftKey(document.getElementById('skey2'));

                               

                                                                stopScanner();

                               

                                                         }

                               

                                            }

                               

                                            else if(key == KEY_SOFT3)

                               

                                            {

                               

                                                         flashSoftKey(document.getElementById('skey3'));

                               

                                                         doQuit();

                               

                                            }

                               

                                                    

                               

                                     }

                               

                                      

                               

                                     function doScan(code)

                               

                                     {

                               

                                            divStatus.innerHTML = 'Scanned Code:
                                ' + code;

                              setTimeout("startScanner()", 1250);

                              }



                              function doSignal(SignalStrength, ESSID, MacAddress, AdapterName, DHCPServer, DHCPStatic, Gateway, IPAddress, RSSI, SubnetMask, Wins )

                              {

                              if(IPAddress == 'undefined')

                              divSignal.innerHTML = 'WLAN Details:
                              Not connected or configured.';

                              else

                              divSignal.innerHTML = 'WLAN Details:
                                Signal = ' + SignalStrength + '  ESSID = ' + ESSID
                              + '
                                IP Address = ' + IPAddress
                              + '
                                MAC = ' + MacAddress;



                              }





                               

                                      

                               

                                     body

                               

                                      

                               

                                     .maindiv

                               

                                      

                               

                                     .product

                               

                                      

                               

                                     .moto

                               

                                                   

                               

                                      

                               

                                      

                               

                                     #skey1

                               

                                      

                               

                                      

                               

                                      

                               

                                      

                               

                                     #skey2

                               

                                      

                               

                                      

                               

                                     #skey3

                               

                                      

                               

                                      

                               

                                     #divStatus

                               

                                      

                               

                                      

                               

                                     #divSignal

                               

                                      

                               

                                     .title

                               

                                      

                               

                                    













                              MK3000 Sample

                              Powered by PocketBrowser



                              Scanner Test:
                                Tap start to enable the scanner...



                              WLAN Details:
                                Please wait...



                              START



                              STOP



                              QUIT











                               

                               

                               

                              For your advice

                               

                              Faisal