admin管理员组文章数量:1297119
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
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
Share Improve this question edited Mar 22, 2011 at 17:14 Billy Moon asked Mar 18, 2011 at 14:12 Billy MoonBilly Moon 58.6k26 gold badges147 silver badges244 bronze badges 1- The original answer 404s, but my (very similar) problem was fixed by adding "e.preventDefault();" to the end of the called function. – amsjntz Commented Sep 28, 2020 at 20:37
4 Answers
Reset to default 4On 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./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 pare 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./p/android/issues/detail?id=4549 http://code.google./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.
本文标签: javascriptSlow touchmove polling on Android via browser vs native appStack Overflow
版权声明:本文标题:javascript - Slow touchmove polling on Android via browser vs native app - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741643265a2390041.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论