android - Calculating data downloaded by webview for a given url by using webview client? -


I am trying to calculate the data I downloaded in my WebView . The following is my Public Code (Webview View, String URL) {super.onPageFinished (see, url) on my WebViewClient

  WebViewClient mWebViewClient = new WebViewClient () {@OverridePageFinished) ; Logs. E (tag, "init onPageFinished ()"); } Override public zeros at @powered (WebView View, string URL, bitmap favicon) {super.page starred (see, url, favicon); Logs. A (tag, "Peace Started (init)"); }};  

In addition to the calculation of the data I am using:

  mWebView.setWebChromeClient (New WebChromeClient () {@ Override publicity at ProgressChanged (WebViewView, int newprogress) {Super.onprogressChangeed (long, new progress), long time current bytes = trafficstats.getUIDRxbytes (processor.muid); long totalbeat = currentbits - lastbeats; log A. (tag, "current bytes == & gt; "+ Total Bytes +" New Progress ==> "+ New Progress);}});  

The following logs are:

  05-06 13: 11: 11.621: e / tag (16381): init onPageStarted () 05-06 13: 11: 11.621: E / TAG (16381): Current Bytes ==> 0 new progress ==> 10 05-06 13: 11: 12.422: E / TAG (16381): Current Bytes ==> 2736 new progress ==> 11 05-06 13: 11: 12.712: E / TAG (16381): Current Bytes ==> 5743 new progress == & gt; 12 05-06 13: 11: 13.353: E / TAG (16381): Current Bytes ==> 28084 new progress ==> 15 05-06 13: 11: 13.393: E / TAG (16381): Current Bytes ==> 42576 new progress == & gt; 17 05-06 13: 11: 14.674: E / TAG (16381): Current Bytes ==> 414446 new progress == & gt; 18 05-06 13: 11: 15.125: E / TAG (16381): Current Bytes ==> 527120 new progress ==> 19 05-06 13: 11: 15.125: E / TAG (16381): Current Bytes ==> 629186 new progress == & gt; 22 05-06 13: 11: 15.125: E / TAG (16381): Current Bytes ==> 629186 new progress == & gt; 24 05-06 13: 11: 15.145: E / TAG (16381): Current Bytes ==> 629186 new progress == & gt; 26 05-06 13: 11: 15.155: E / TAG (16381): Current Bytes ==> 629186 new progress == & gt; 29 05-06 13: 11: 15.155: E / TAG (16381): Current Bytes ==> 629186 new progress == & gt; 31 05-06 13: 11: 15.175: E / TAG (16381): Current Bytes ==> 629186 new progress == & gt; 34 05-06 13: 11: 16.576: E / TAG (16381): Current Bytes ==> 629186 new progress == & gt; 46 05-06 13: 11: 17.107: E / TAG (16381): Current Bytes ==> 629186 new progress == & gt; 51 05-06 13: 11: 17.127: E / Tag (16381): Current Bytes ==> 629186 new progress == & gt; 55 05-06 13: 11: 17.157: E / Tag (16381): Current Bytes ==> 629186 new progress == & gt; 57 05-06 13: 11: 17.167: E / TAG (16381): Current Bytes ==> 629186 new progress == & gt; 59 05-06 13: 11: 17.177: E / TAG (16381): Current Bytes ==> 629186 new progress == & gt; 72 05-06 13: 11: 17.187: E / TAG (16381): Current Bytes ==> 629186 new progress == & gt; 79 05-06 13: 11: 17.197: E / TAG (16381): Current Bytes ==> 629186 new progress == & gt; 81 05-06 13: 11: 17.197: E / TAG (16381): Current Bytes ==> 629186 new progress == & gt; 84 05-06 13: 11: 17.217: E / TAG (16381): Current Bytes ==> 629186 new progress == & gt; 88 05-06 13: 11: 17.517: E / Tag (16381): init onPageFinished () 05-06 13: 11: 17.517: E / TAG (16381): Current Bytes ==> 629186 new progress == & gt; 100  

As we can see that the data byte stabilizes after a certain period, I know what is happening in that time period? Finally, in order to provide data on this WebView is not used to provide data on the onPageFinished () in the end please thank me in advance, thank you in advance.

There may be tons of things, for example, WebView may be getting resources from the cache, Progress can reflect the weight of the data: URL, etc.

Changing progress on The API was intended to run only one progress bar, so the values ​​you get from it should be considered as 'best guess'.


Comments

Popular posts from this blog

c++ - ERROR: cannot open source file x11\xlib.h -

c - What are pthread cancelation points used for? -

c# - Show a huge number of data in DevExpress GridView -