Slow touchmove polling on Android via browser vs native app
Seems to me that iPhone captures touchmove events about 4 times more frequently than Android.
I am coding in javascript and accessing through browser. As far as I know, both Android and iPhone use webkit - so I was not expecting such a difference.
Is there any way to increase the polling for Androids browser?
开发者_运维技巧Is the polling as slow from a web-view of a native app on Android platform?
Is there any way to increase the polling for a web-view on Android platform?
Is the polling as slow in a native app on Android platform?
I know that hardware/firmware varies on Android.
What I really want to know - is any known method to increase the polling rate of android touchscreen via web-view, native code or javascript inside browser
On my cheap android ICS tablet the touchmove polling frequency is really slow. It increases the polling frequency noticeably inside a div with
-webkit-transform: translate3d(0, 0, 0);
in its css.
Im not super familiar with this. But I may be able to help some.
Is there any way to increase the polling for Androids browser?
- If so it would likely require modifying the source code for it and rebuilding it.
Is the polling as slow from a web-view of a native app on Android platform?
- I don't know but, here is a link to a very simple WebTest app which just contains a WebView with javascript enabled and a dialog that asks for the URL to go to. You can use it to test this if you like. http://dl.dropbox.com/u/5724095/Android%20Apps/WebTest.apk
Is there any way to increase the polling for a web-view on Android platform?
- There doesn't seem to be any obvious way to do it from the methods the webview provides. If you can it would probably require messing with the source of the WebView widget.
Is the polling as slow in a native app on Android platform?
- If you can give me some sort of metric for how many calls you're getting(perhaps calls per second?) I can test it against a non-webview in the onTouchListener and compare the two.
Edit: I did some simple tests with an OnTouchListener on a non-webview it looks like I am getting about 35-38 or so calls to onTouch() per second. To get this number I set up a listener that saves a timeStamp in ACTION_DOWN, then increments a counter every time onTouch is called, then reports what the counter is at whenever current time is 1000 millis more than start time.
I tried the web-view test, and unfortunately it seems the same as the browser.
Here is some data for captured touchmove events drawing a letter a. The duration of both is similar (663 vs 672) and all units are in miliseconds.
"iPhone_via_browser_times": // (in ms from the touchstart event) [0,104,125,136,151,167,183,199,215,231,247,263,279,295,311,327,347,357,372,391,407,423,439,455,503,519,535,551,567,583,603,615,631,647,663]
"Android_via_webview_times": // (in ms from touchstart) [0,56,140,195,252,336,392,449,531,615,672]
"Android_via_browser_times": // (in ms) [0,105,161,217,300,356,413,497,553]
Android via webview polls on average every (672/11) 61ms Android via browser polls on average every (553/9) 61ms
iPhone polls on average every (663/35) 19ms
But I have other data from other Android devices where the polling is worse.
Found some issues connected with discussed interval. http://code.google.com/p/android/issues/detail?id=4549 http://code.google.com/p/android/issues/detail?id=5491
I get stuck because of not smoothed line drawing canvas by user. But we use smooth methods dynamically to solve this problem.
精彩评论