Xamarin Forms: escriba un archivo en el almacenamiento interno del dispositivo Android

Estoy desarrollando una aplicación multiplataforma usando el proyecto PCL Xamarin Forms. En esto, necesito escribir un archivo en el almacenamiento interno de Android para poder acceder a él. He otorgado permisos de escritura en almacenamiento externo, pero cuando intento escribir el archivo dice que se ha denegado el acceso.

Esto es lo que probé:

Java.IO.File DataDirectoryPath = Android.OS.Environment.DataDirectory;
string dirPath = DataDirectoryPath.AbsolutePath + "/MyFolder";
bool exists = Directory.Exists(dirPath);
string filepath = dirPath + "/test.txt";
if (!exists)
{
    Directory.CreateDirectory(dirPath);
    if (!File.Exists(filepath))
    {
        File.Create(filepath).Dispose();
        using (TextWriter tw = new StreamWriter(filepath))
        {
            tw.WriteLine("The very first line!");
            tw.Close();
        }
    }
}

Respuestas a la pregunta(1)

Su respuesta a la pregunta