9 Replies Latest reply on Jan 15, 2016 9:07 AM by Robert Galvin

    Issue with phonegap app

    Kishor PV

      We have a phonegap app which is deployed in MC40 device. We are not getting very great touch experience in phonegap app. have to click button multiple times before it works.

       

      Has anyone else also faced such issues with phonegap apps in Zebra android devices?          

        • Re: Issue with phonegap app
          Robert Galvin

          This sounds to me like the well known 300ms delay problem. You either have to use a framework like Ionic that has this handled, or include a microlibrary like fastclick.js into your application. Basically, the webview is waiting for touch gesturing

            • Re: Issue with phonegap app
              Kishor PV

              We have used fastclick.js and same app is very smooth in Samsung galaxy s4.

                • Re: Issue with phonegap app
                  Robert Galvin

                  Is it possible to share a  simplified test page to reproduce the problem? What version of Android is being used on MC40 and Galaxy S4? Other details about the page structure may be helpful including knowing what UI elements in DOM are present and what CSS styling is being used. If you can post a short video showing the two, that would be very helpful. If fastclick is being used and you see the same exact code run differently on the S4 I would suspect:

                   

                  - Differences in Webview being used (controlled by OS level)

                  - Size of screen effects the size of the buttons, reducing the 'touch zone' on the MC40

              • Re: Issue with phonegap app
                Kishor PV

                Sorry for taking it so long. I was bit busy with other activites.

                 

                Here is the small code snippet that will help you understand the issue and the logs.

                 

                Code :

                 

                -----

                var hammertime = new Hammer($($element)[0], {});

                -------

                hammertime.on("gesture", function(e){

                   switch(e.gesture.eventType){

                   case 'start':

                  ontouchstart(e);

                   break;

                   case 'move':

                  ontouchmove(e);

                   break;

                   case 'end':

                  ontouchend(e);

                   break;

                   default:

                   break;

                  }

                });

                 

                --------

                function ontouchstart(e){

                     console.log("--------touch started-------");

                }

                function ontouchmove(e){

                     console.log("--------touch moved-------");

                }

                 

                function ontouchend(e){

                     console.log("--------touch end-------");

                }

                 

                 

                      Android logs :

                 

                --------touch started-------

                --------touch moved-------

                --------touch end-------

                 

                I'm still dragging but touch end is fired

                 

                 

                IOS logs:

                 

                --------touch started-------

                (45)--------touch moved-------

                --------touch end-------

                 

                touch moved is keep logging until I left it and touch end is fired

                 

                Any help is greatly appreciated.

                  • Re: Issue with phonegap app
                    Derek Warren

                    Have you tried modifying the touch threshold for a larger pixel range? This appears to manifest itself on lower resolution devices hence the reason for it not being seen on the S4.

                     

                    The device is registering the 'touch' as a swipe because there might be a small drag on the button causing the button not to fire. Try enabling the Pointer Location debug tool in Android to determine if this is what is occurring (Settings -> Developer Options -> Pointer Location), you'll see something similar to the screenshot below at the top of your device.

                     

                    This tool displays the screen coordinates while you touch, once you are no longer touching the screen the values change from coordinates to difference from start to end. If you start at 100x,100y and complete your touch at 150x,125y you’ll see the value change to dX:50 and dY:25. If you see the dX or dY turn red when the button isn't firing, but remain grey when the button does work that is most likely the issue.

                  • Re: Issue with phonegap app
                    Christopher Sather

                    Hi, I am posting the sample app on behalf of Kishore.  He created a sample app to show the touch issues he was having on MC40 and TC70.  I tried it on the TC70 and MC40 and can see it is had to swipe as well.  The complete source is posted here.  rph467, The specified item was not found. and cfh463 can you take a look for any tips you can offer Kishore.

                     

                    Thanks

                    • Re: Issue with phonegap app
                      Robert Galvin

                      I was able to get good performance by taking your code and just updating Hammer.JS. You were running a quite old version Hammer.JS - v1.1.3, I updated it to the latest Hammer.JS - v2.0.6. attached is the project and video showing the performance. This was on an MC40 updated to the latest KitKat

                       

                       

                       

                      1 of 1 people found this helpful