title: Android 11 (api 30) How to get a path for SharedStorage using Xamarin?
body: <p>I want to get a directory path (not ask the user for it) to store app files that can also be seen by the user (ie db and log files) that will work with Android 11 and don't mind if not compatible with Android 9 anymore.</p>
  <p>With Android 9 this line of code was doing exactly what was requested.</p>
  <pre><code>if (global::Android.OS.Environment.MediaMounted.Equals(global::Android.OS.Environment.ExternalStorageState))
          {
              appDirectory = new Java.IO.File(global::Android.OS.Environment.ExternalStorageDirectory, global::Android.App.Application.Context.PackageName);
          }
  </code></pre>
  <p>But it was deprecated by Android 11 and I tried to replace it by the following but the user can't access/see the db and log files anymore. (And I don't want to use requestLegacyExternalStorage flag or similar flag)</p>
  <pre><code>appDirectory = new Java.IO.File(Application.Context.GetExternalFilesDir(null).AbsolutePath, global::Android.App.Application.Context.PackageName);
  </code></pre>
  <p>I think that I should use Writable Non Media Shared Storage (can be accessed by other apps if I understand correctly the <a href="https://miro.medium.com/max/1400/1*tKvVVA8jCbhGEJgL_lj0nA.png" rel="nofollow noreferrer">storage drawing here</a>) but can't find a way to call a method that would return/generate such kind of path.</p>
  <p>I'm really new to Android, trying to learn, so please be kind :)
  Thanks in advance!</p>