Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Signature pad is slow on android

I am using Thomas J Bradley plugin for drawing signature on touch devices like ipad/xoom/galaxy... I have a simple jsp page which includes jquery and signature pad scripts

 $('div.signaturePadClass').signaturePad({displayOnly:false})

works like a charm on ipad, but it is kind a slow on android (xoom/samsung galaxy). I checked the plugin homepage on these devices, and the demo on the home page is also slow on android.

Is there a workaround?.. fix for this? Or is there a better plugin out there?. If no, then whats the reason for this slowness... is it just a slow android?

like image 372
zoom_pat277 Avatar asked Aug 29 '11 16:08

zoom_pat277


1 Answers

Environment

Unfortunately, you cannot influence the way android (the used web browser, did you test it on different ones?) executes javascript. You could use a 3rd party javascript engine but X8 (which uses google chrome) is said to be one of the best, already.

Hardware

If you are using Android 3.0 or above you can enable hardware acceleration. Add android:hardwareAccelerated="true" to your manifest application tag to enable it. Hopefully it may work.

Optimize the code

A large amount of optimizations should be concerned when writing javascript for mobile devices. The two most important are:

  • Do as much as possible serverside (To execute only the javascript which really is neccessary)
  • Avoid manipulating the DOM (which makes javascript that slow)
  • For more performance hints look here and here
like image 134
poitroae Avatar answered Oct 01 '22 20:10

poitroae