title: Android R – Create a text file in Download folder using Scoped storage (MediaStore.Downloads)
body: <p>My app needs to save a string in a text file in Download folder. Currently (target:  API 29 (Q) I am using the FILE API with :</p>
  <pre><code>&lt;uses-permission android:name=&quot;android.permission.READ_EXTERNAL_STORAGE&quot;/&gt;
  &lt;uses-permission android:name=&quot;android.permission.WRITE_EXTERNAL_STORAGE&quot;/&gt;
  android:requestLegacyExternalStorage=&quot;true&quot;
  </code></pre>
  <p>But for API 30 (R),  if I understood well, I have to migrate this to Scoped storage (MediaStore.Downloads).</p>
  <p>And here, I am a bit lost. I can’t find good documentation or snippet showing how to  create a text file in Download.  I would appriciate if someone could explain or show how to do this?</p>