Android - WebViewClient 加载页面极其缓慢
作为一名开发人员,在构建在 3G 连接的 Android webviewclient 上运行的应用程序(带有网页)时,我有过非常糟糕的经历。我的一些用户表示某些页面需要 10 分钟才能加载。 (我不知道他们是否夸大其词,因为他们感到沮丧。)就我个人而言,我使用运行 Android 2.2 的 HTC Desire,并用我自己的手机测试了我的应用程序。事实上,即使对于使用本地存储的网页来发出 AJAX 请求的应用程序,它在 3G 上也非常慢。大多数时候,它只会超时并显示空白页面。当它在 WIFI 上时,它工作正常并且速度非常快。
我听很多人说 Android 2.2 上的本机浏览器速度非常快。但对我来说,我必须说本机浏览器应用程序在 3G 上也非常慢。有时,Google 移动主页甚至无法完成加载。我在新加坡,所以大多数地方 3G 覆盖应该都很好。
是否是设备硬件导致了问题?
As a developer, I have had pretty bad experiences when it comes to building apps (with web pages) that run on the Android webviewclient on 3G connection. A few of my users are saying that some pages take up to 10 minutes to load. (I don't know if they have exaggerated because they are frustrated.) Personally, I use HTC Desire running Android 2.2 and have tested my apps with my own phone. Indeed, even for apps that use locally stored web pages to make AJAX requests, it is extremely slow on 3G. Most of the time, it will just timeout and show up a blank page. When it's on WIFI, it works fine and is real fast.
I have heard many say that the native browser on Android 2.2 is extremely fast. For me, I must however say that the native browser app is also very slow on 3G. Sometimes, the Google mobile home page does not even finish loading. I'm in Singapore and so 3G coverage should be fine in most places.
Is it the device hardware that is causing the problem?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不知道与 WebView 加载时间特别相关的设备特定性能问题。但是,您可能想要添加请求超时和网络连接更改侦听器。有关其他信息,您可以对请求进行计时并报告有关缓慢请求的设备和连接信息。
I am not aware of device specific performance issues specifically related to WebView load times. However, you may want to add both a request timeout and a network connectivity change listener. For additional information you can time requests and report back device and connectivity information on slow requests.