Why android webview is much slower than the native android browser?
In my application, i have some external urls to load, for which i am using a custom webview. but the performance of this webview is very very slow. If i open the same url in 开发者_如何学Pythonnative android browser, it works fine. but in the webview, it just takes a lot of time to load the page. Is there anyway that the performance of a webview can be enhanced in terms of loading a webpage time? Help is always appreciated.
Usama, WebViews will be little slower than the browser as here every activity has to have a callback to the Android app layer.
Having said that, see if you can disable javascript (if it's not used in your app) and more importantly check the caching behavior in the webview that has been set. WebSettings has some methods related to caching like - setAppCacheEnabled, setAppCacheMaxSize, setCacheMode etc.
setDatabaseEnabled, javascrpt, loadImagesAutomatically are other properties that might impact the load time.
精彩评论