title: Saving media files in android
body: <p>I just started with android development and I am very confused about how to save media files to a custom folder in external storage. I have read about scoped storage, Mediastore and I still don't get it.</p>
  <p>I'm trying to save files to my own folder in the external storage (just like the Whatsapp folder in external storage). I want the structure to be as so:</p>
  <pre><code>(EXTERNAL STORAGE ROOT)
   |--- (RandomFolder)
   |--- (Whatsapp)
   |--- (MyFolder)
          |---(Images)
          |---(Videos)
   |--- ...
  </code></pre>
  <p>I do not want the media files to be stored in default media directories (such as Pictures/ or DCIM/). I have some questions:</p>
  <ol>
  <li>Which one to use? Scoped storage or Mediastore API?</li>
  <li>How to implement the above?</li>
  </ol>
  <p>Additional Information:</p>
  <ol>
  <li>I want the files to remain even when the app is uninstalled</li>
  <li>My app targets Android 10 (API 29), but minSdkVersion is Android 8.0 (API 26)</li>
  <li>I will be using OutputStream to save my files.</li>
  </ol>
  <p>So which method should I take?</p>