0
votes

I created a simple android application with jquery and phonegap. When testing the app with phone, I noticed that vibration effect, that I have used to indicate that user touches a button, comes after a delay of maybe 0,5 seconds. This is way too long delay and just confuses the user.

Is this just the downside of using phonegap? Or is there any configuration or additional frameworks which could be used to make the app response and produce the vibration more quickly?

I installed the vibration plugin like this: phonegap local plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-vibration.git

I use the code below to create the vibration effect.

navigator.notification.vibrate(200);

My phone gap version is 3.0.0-0.14.3

1

1 Answers

1
votes

Are you sure the delay is being caused by the vibrate function and not the act of clicking the button itself? Depending what event you use to determine if your button is clicked, Webkit Mobile browsers can add a 300ms delay, resulting in the sort of lag you're experiencing.

It might be worth checking out this article on eliminating click delay in Phonegap. Personally, I used the fastclick library to resolve the issue in my apps.