tags:

views:

22

answers:

2

I'm looking for a way to output the total download time every time a new page is opened in the Android browser.

I've looked around, but can't find a place to put a timestamp for downloading a web page. There's a performance monitor in onPageStarted and onPageFinished measuring the page loading time, but nothing (that I can see) that measures the download time.

A: 

The onPageStarted() and onPageFinished() methods are on WebViewClient and are for use with WebView in your own app, not with any existing browser application.

I am not aware that there is any API to download started/stopped even for WebView, and getting that for the user's choice of browser would be a privacy violation, since it would have to tell you what URL was being downloaded for the performance metric to have meaning.

CommonsWare
A: 

I ended up altering android.net.http.Request. Putting a time stamp at the beginning and end of the readResponse method did the trick.

Vax456