title: How to create an app image folder to show in Android gallery
body: <p>I have an app where the user creates an image and then I want to save it so it's visible form the default gallery application.</p>
  
  <p>Now I don't want the pictures to be saved in the same folder as the pictures taken from the camera, I want them to be saved in a folder dedicated to the app, just like images from apps like whatsapp or facebook.</p>
  
  <p>I've tried saving them in this two locations:</p>
  
  <pre><code>File imagePath = new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM)+ File.separator + appDirectoryName + File.separator);
  </code></pre>
  
  <p>and here</p>
  
  <pre><code>File imagePath = new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES)+ File.separator + appDirectoryName + File.separator);
  </code></pre>
  
  <p>If I browse through the phone I see that I successfully save the images but they don't show in the gallery app. It is obvious that I'm missing something but I don't know what it is. Maybe adding some kind of metadata to the files or folders so the gallery recognizes them?</p>