title: getExternalStoragePublicDirectory deprecated in Android Q
body: <p>As <a href="https://developer.android.com/reference/android/os/Environment#getExternalStoragePublicDirectory(java.lang.String)" rel="nofollow noreferrer">getExternalStoragePublicDirectory</a> has been deprecated in <code>Android Q</code>, and the recommendation is to use other means. then how can we specify that we want to store the generated photos from a camera app into the <code>DCIM</code> folder, or a custom sub-folder within the <code>DCIM</code>?</p>
  <p>The documentation states that the next 3 options are the new preferred alternatives:</p>
  <ol>
  <li><a href="https://developer.android.com/reference/android/content/Context.html#getExternalFilesDir(java.lang.String)" rel="nofollow noreferrer">Context#getExternalFilesDir(String)</a></li>
  <li><a href="https://developer.android.com/reference/android/content/Intent.html#ACTION_OPEN_DOCUMENT" rel="nofollow noreferrer">Intent#ACTION_OPEN_DOCUMENT</a></li>
  <li><a href="https://developer.android.com/reference/android/provider/MediaStore.html" rel="nofollow noreferrer">MediaStore</a></li>
  </ol>
  <p>Option 1 is out of the questions as it would mean that the photos get deleted if the app gets uninstalled.</p>
  <p>Option 2 is also not a choice, as it would require the user to pick the location through the SAF file explorer.</p>
  <p>We are left with option 3, the MediaStore; but at the time of this question there is no documentation on how to use it as a replacement for getExternalStoragePublicDirectory in Android Q.</p>