title: How to download files to downloads folder, etc
body: <p>With the recent release of Android Q Beta, <a href="https://developer.android.com/reference/android/os/Environment#getExternalStoragePublicDirectory(java.lang.String)" rel="nofollow noreferrer"><code>getExternalStoragePublicDirectory()</code></a> became deprecated. Now if someone wants to create a folder he has to either use <a href="https://developer.android.com/reference/android/content/Context.html#getExternalFilesDir(java.lang.String)" rel="nofollow noreferrer"><code>getExternalFilesDir()</code></a> or use MediaStore. But I am developing an app where the user clicks to download his profile picture and I download it using Firebase Storage. Now, the download process works flawlessly, the real problem is storing it in a file. Now I don't want to store in my private data folder like:</p>
  
  <pre><code>File file = new File(getExternalFilesDir(), "file.jpg");
  </code></pre>
  
  <p>I want it to download in the Downloads folder, so I need to use the deprecated method. Is there a new way to store files in a folder like the Downloads, or Music for Android Q and later? What should I do?</p>
  
  <p><strong>Note:</strong> I had asked this question yesterday in a different manner, but the answers did not satisfy me. So I decided to ask this question with more specific details.</p>
  
  <hr>
  
  <p><strong>Edit:</strong> I did check the documentation here: <a href="https://developer.android.com/preview/privacy/scoped-storage" rel="nofollow noreferrer">https://developer.android.com/preview/privacy/scoped-storage</a>. In fact, I've been researching for the previous three days, but I don't know how to implement it in my app. An example would be appreciated.</p>
  
  <p>Also, I'm using <strong>Java</strong>, and not Kotlin.</p>