Barcode API "autoEnter" property is not honored in Android when Android wakes

We are facing very strange result in Android. Our application and set of text boxes that needs to be scanned we have set application to focus to next text box when "Enter" key is pressed. Since our SOP is to not let operators touch the screen during this process, we set "EB.Barcode.autoEnter = true" which works fine until Scanner sleeps and awakes again.

We are using Android MC9200

 

Following is the test code which proves (when tested on Android) that "EB.Barcode.autoEnter = true " is not being honored when android awakes.

 

 

<!DOCTYPE html>

<html>

<head>

<script type="text/javaScript" src="/js/jquery.min.js"></script>

<script type="text/javaScript" src="/js/ebapi-modules.js"></script>

</head>

<body>

<div id="Message" >

    Text1 :<input type="text" class="inputs" id="firstItem" />

    <br>

    Text2 :<input type="text" class="inputs"/>

    <br>

    Text3 :<input type="text" class="inputs"/>

</div>

<script type="text/javascript">

   

    function EnableScanner(enabled) {

            if(enabled) {

                try {                      

                        EB.Barcode.autoEnter = true;

                        EB.Barcode.enable();                   

   

                 } catch (e) { alert(e.message); }

             }

             else { try { EB.Barcode.disable(); } catch (ex) { alert(ex.message); } }  

     }

    

   

 

 

    $(document).ready(function(){

          EnableScanner(true);

          $('.inputs').keydown(function (e) {

              if (e.which === 13) {

                   var index = $('.inputs').index(this) + 1;

                  $('.inputs').eq(index).focus();

              }

         });  

         $("#firstItem").focus();       

    });   

   

</script>   

</body>

</html>

Saad Nisar
As workaround I am using

As workaround I am using

setInterval(function(){EB.Barcode.autoEnter = true;},200);

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Log in to post comments