title: Android - Save a picture with its URL on external storage
body: <p>I've searched and tried everything I found about this topic on Google and StackOverflow but I didn't find anyway to make it work.
  I have this code but it throws me a FATAL EXCEPTION.
  I think that, as I am an Android Rookie there's something I do wrong. Help me please ^^</p>
  
  <pre><code>    public void svgPhoto() throws IOException {
      String dir = Environment.getExternalStorageDirectory().toString();
      OutputStream fos = null;
      File file = new File(dir,"downloadImage.JPEG");
      Bitmap bm =BitmapFactory.decodeFile("http://perlbal.hi-pi.com/blog-images/3278/gd/1242316719/Chat-chat.jpg");
      fos = new FileOutputStream(file);
      BufferedOutputStream bos = new BufferedOutputStream(fos);
      bm.compress(Bitmap.CompressFormat.JPEG, 50, bos);
      bos.flush();
      bos.close();
  </code></pre>