title: Save image on external Storage
body: <p>Hey I want to save an image in the external storage. I got two versions out of here but both aren't working. Goal is that the user clicks a button and the image is saved and then the user can also see it in the gallery. So here is Version one:</p>
  
  <pre><code>            String path = Environment.getExternalStorageDirectory().getPath();
              File outputDir= new File(path);
              outputDir.mkdirs();
              File newFile = new File(path+"/"+"test.png");
              FileOutputStream out = null;
              try {
                  out = new FileOutputStream(newFile);
                  mutableBitmap.compress(Bitmap.CompressFormat.PNG, 100, out);
              } catch (FileNotFoundException e) {
                  e.printStackTrace();
              }
  </code></pre>
  
  <p>And this is Version 2:</p>
  
  <pre><code>            String path = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES) + File.separator + "MyApplication";
              File outputDir= new File(path);
              outputDir.mkdirs();
              File newFile = new File(path+"/"+"test.png");
              FileOutputStream out = null;
              try {
                  out = new FileOutputStream(newFile);
                  mutableBitmap.compress(Bitmap.CompressFormat.PNG, 100, out);
              } catch (FileNotFoundException e) {
                  e.printStackTrace();
              }
  </code></pre>
  
  <p>Thanks for help</p>