I am using Xamarin.Android and I want to save a .txt
file to the SD card. Here is the code that I am using:
private void SavetoSd()
{
If you're on Android 6.0+ you will need to perform a runtime check for permissions. This can be done like so:
if ((CheckSelfPermission(Permission.ReadExternalStorage) == (int)Permission.Granted) &&
(CheckSelfPermission(Permission.WriteExternalStorage) == (int)Permission.Granted))
More information on this can be found in the android documentation here.