title: Speed up image download time
body: <p>in my app I'm downloading images I get from an URL. The problem here is that it takes wayy too long. The images are compressed and only 9km big. I'm downloading 50 of them, so let's say 500kByte of images are being downloaded by the app. This should be pretty fast, right? Well, it isn't. I'm sometimes wating for 20 seconds until it's loaded. What is taking so long there? I have a pretty easy way to download the images. Here it is</p>
  
  <pre><code>int downloadingImages = getDownloadImageCount();
          System.out.println(downloadingImages);
          if(downloadingImages == 0){
              for(int c = downloadingImages; c &lt; 50; c++){
                  try{                    
  
                          bitmapArr[c]        = getBitmapFromURL(imageURLArr[c]);
                          setDownloadImageCount(50);
                          publishProgress(c);
                      } catch (FileNotFoundException f1){
                          Log.v("FileNotFoundException", "Bitmap konnte nicht geladen werden");
                  } catch(NullPointerException e){
  
                  } catch (IllegalStateException ie){
  
                  } 
                  setDownloadImageCount(50);
              }
          }
  </code></pre>
  
  <p>This is the getBitmapFromUrl function</p>
  
  <pre><code>public static Bitmap getBitmapFromURL(String src) throws FileNotFoundException {
      try {
          //Downloading the image
          URL url = new URL(src);
          HttpURLConnection connection = (HttpURLConnection) url.openConnection();
          connection.setDoInput(true);
          connection.connect();
          try{
              //Saving the image to a bitmap and return it
              InputStream input = connection.getInputStream();
              Bitmap myBitmap = BitmapFactory.decodeStream(input);
              return myBitmap;
              //Catch Exception if file not found
          } catch(FileNotFoundException ffe){
              Log.v("FileNotFoundException", "getBitmapFromURLMethod");
              return null;
          }        
          //Catch Exception if error at input and output
      } catch (IOException e) {
          e.printStackTrace();
          return null;
      } 
  }
  </code></pre>
  
  <p>I mean, what is taking so long there? How can I increase the speed. I will use cahing for images later, but still... I mean it's 500kbs and takes so long. Why is that?</p>