First, the phenomenon
The usual way to download files via the Android WebView is
1. Rewrite the Downloadlistener Ondownloadstart method, pop-up dialog box in Ondownloadstart method prompts the user to have a new file to download
2. After the user clicks OK, downloads the file through the HTTP GET
As a result of the Android WebView, the above download file steps involve two get operations. The first time is when the user clicks on the download link in the WebView, WebView sends the HTTP GET request automatically, this time the server besides sends the file information to send over, will simultaneously send the file the content to the WebView. The second time was initiated in step 2 by a program of your own design.
To verify this, my own browser in the Android 4.4 system accessed and downloaded the test link and Wireshark to see the results. With the following three diagrams, I think it is possible to verify that the same document was actually transmitted two times. Because two different HTTP GET requests can see the successive TCP packets that the server sends to the client.
See more highlights of this column: http://www.bianceng.cnhttp://www.bianceng.cn/OS/extra/