Android :understanding the download process -


I am trying to calculate my WiFi speed so I am downloading a file from a server (10 MB ). Well downloading is working very well. But I'm not sure how to press the downloads of every available data packet.

I am using a part of this code, I want to understand the difference between the two sizes: 8192 and 1024, pulp of every size.

  inputstream input = new beefInputstream (url.openstream (), 8192);  

and this line

  byte data [] = new byte [1024];  

And how I used them:

  protected string doInBackground (string ... f_url) {int count; Int lenghtOfFile = 0; {URL url = Try new URL (f_url [0]); Comm = (HttpURL connection) url.openConnection (); URL Connection Connection = url.openConnection (); Conection.connect (); LenghtOfFile = conection.getContentLength (); // file inputstream input = new buffer inputstream (url.openstream (), 8192); // output stream output stream output = new file output stream ("/ sdcard / downloadedfile.jpg"); Byte data [] = new byte [1024]; Long total = 0; While ((count = input.read (data))! = -1) {actuaStartlTime = System.currentTimeMillis (); Total + = Calculation; }}  

This is a sample of output: Curate the time and information downloaded. I do not see any relativity between the size of downloaded data.

  05-06 15: 32: 36.883: I / Downloaded Data (13146): 244392 05-06 15: 32: 36.883: m / present time in milliseconds (13146): 1399386756881 05-06 15: 32: 37.329: I / Downloaded Data (13146): 245840 05-06 15: 32: 37.329: m / s Current Time Milliseconds (13146): 1399386757328 05-06 15: 32: 37.331: I / Downloaded Data (13146): 247288 05-06 15: 32: 37.332: m / present time in milliseconds (13146): 1399386757330 05-06 15: 32: 37.334: I / Download data (13146): 250184 05-06 15: 32: 37.334: m / s current time milliseconds (13146): 1399386757333 05-06 15: 32: 37.347: I / Downloaded data (13146): 251632 05-06 15:32: 37.347: me / Current time in millisecond (13146): 1399386757345 05-06 15: 32: 37.349: I / Downloaded data (13146): 262144 05-06 15: 32: 37.349: Current time in millisecond (13146): 1399386757348 05-06 15: 32: 37.637: I / Downloaded Data (13146): 288208 05-06 15: 32: 37.637: M / s Current Time Milliseconds (13146): 1399386757636 05-06 15: 32: 38.050: I / Downloaded Data (1 3146): 28 9 656 05-06 15: 32: 38.050: The current time in m / s is the current time (13146): 1399386758049 05-06 15: 32: 38.063: I / Downloaded data (13146): 298344 05 -06 15: 32: 38.063: Current time in mi / millisecond (13146): 1399386758062 05-06 15: 32: 38.067: I / O Those Loaded Data (13146): 304136 05-06 15: 32: 38.068: The current time in m / s sec (13146): 1399386758066 05-06 15: 32: 38.070: I / Downloaded data (13146): 309928 05 -06 15: 32: 38.071: m / s current time in milliseconds (13146): 1399386758069 05-06 15: 32: 38.079: I / Download data (13146): 317168  

Thanks in advance .


Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -