title: android store photos to public directory and get access to their file system url
body: <p>I'm doing an android app with the capability to take pictures with the camera and send them to us, the company who distributes the app. Seems like an easy task, right? ;-)</p>
  
  <p>The documentation describes how you are supposed to do it: <a href="https://developer.android.com/training/camera/photobasics.html" rel="nofollow noreferrer">https://developer.android.com/training/camera/photobasics.html</a></p>
  
  <p>It also says </p>
  
  <blockquote>
    <p>"Note: If you saved your photo to the directory provided by
    getExternalFilesDir(), the media scanner cannot access the files
    because they are private to your app."</p>
  </blockquote>
  
  <p>Yeah, we are happy that we can store things privately, but I want our users to see their pictures in the gallery app. How do I store pictures to the public folder? The doc doesn't describe that. </p>
  
  <p>Then, the doc describes that we should use <code>FileProvider.getUriForFile</code> which returns a <code>content://-uri</code>. Some <code>getContentResolver().query()</code> cursor mechanism is supposed to give me a real url to the filesystem, but it doesn't seem to work reliably and my upload class doesn't understand <code>content://-uris</code>. I get that we need security restrictions across package boundaries, but hey, I want the data back I just wrote! Is there a simple and reliable way to get a <code>file://-uri</code> for my pictures?</p>
  
  <p>Thanks!</p>