Android url.openStream slow?
<p>Im using the following code to retrieve some text from a http-server. The size is less than 1 kB and is generated in 0.002 milliseconds</p>

<p>However, retreiving the data may take 600 ms, but mostly between 2000 and 5000 ms.</p>

<p>the following code is used:</p>

<pre><code>long starttime = System.currentTimeMillis();
      StringBuffer SB = new StringBuffer();
      Common.toLog("101 took "+ (System.currentTimeMillis() - starttime) + " ms");
      try {
          URL url = new URL(Common.server+request);
          Common.toLog("102 took "+ (System.currentTimeMillis() - starttime) + " ms");
          InputStreamReader ISR = new InputStreamReader(url.openStream());
          Common.toLog("102a took "+ (System.currentTimeMillis() - starttime) + " ms");
          BufferedReader in = new BufferedReader(ISR);
          Common.toLog("103 took "+ (System.currentTimeMillis() - starttime) + " ms");
          String inputLine;
          while ((inputLine = in.readLine()) != null) {
              SB.append(inputLine);
          }

          in.close();
          Common.toLog("105 took "+ (System.currentTimeMillis() - starttime) + " ms");
      } catch (IOException e)
      {
          Common.toLog("Could not make connection 1");
          showMSG(R.string.ERROR_NO_INTERNET, true);
      }
</code></pre>

<p>The most timeconsuming method is between log-point 102 and point 102a. When using chrome i can load <a href="http://home.peterelzinga.eu/phpjsinterface/browse.php?action=getCPL" rel="nofollow">the page</a> within 300-350 ms. I would like to know if there is a more efficient way to retrieve this data</p>
