0

I am trying to optimize Android WebView loading times for pages, so first thing I need to do is measure the time to display properly as well as total download time. How can I measure how long it takes for the WebView to display the page?

 webWebClient.onPageFinished()

is not the right callback because I am seeing the page display at about 3 seconds, but the onPageFinished is called many seconds later depending on the page ... So what is the callback when the WebView actually displays the content that has been downloaded? As opposed to having downloaded ALL of the content?

UPDATE: To clarify I am trying to determine how many seconds to display the content visually. How long before user can scroll etc. NOT how long to download the page completely.

  • 1
    Optimizing the loading time can be achieved via adding this line in your xml android:hardwareAccelerated="true" –  Apr 11 '16 at 09:29
  • @Viren Ok, I'll add that. What I am experiencing is that the pages are just not cached too. I have tried loading techcrunch.com pages and it takes 3 seconds to load each page on my connection. But to fully download everything about 10 seconds or more. I am wondering if maybe the page's have no-cache or something. How can I always cache no matter what? – FunctionallyReactive Apr 11 '16 at 09:53
  • please refer http://stackoverflow.com/questions/8410830/saving-webpage-in-cache-using-webview-in-android –  Apr 11 '16 at 10:57

0 Answers0