Access the Android Special Folder Path by using Environment

You are looking for the root of GetExternalFilesDir, just pass a null:

Example:

var externalAppPathNoSec = GetExternalFilesDir(string.Empty).Path;

Note: This is a Context-based instance method, you can access it via the Android application context, an Activity, etc… (see the link below to the Android Context docs)

  • Shared storage may not always be available, since removable media can be ejected by the user. Media state can be checked using Environment.getExternalStorageState(File).

  • There is no security enforced with these files. For example, any application holding Manifest.permission.WRITE_EXTERNAL_STORAGE can write to these files.

re: https://developer.android.com/reference/android/content/Context#getExternalFilesDir(java.lang.String)

Leave a Comment