I have a bitmap that I want to store in the device (either internally or externally) it worked correctly, but when I try to save it it marks me the following error:
System.UnauthorizedAccessException: Access to the path "/storage/emulated/0/imagen.png" is denied.
This is where I try to save it:
var sdCardPath = Android.OS.Environment.ExternalStorageDirectory.AbsolutePath;
var filePath = System.IO.Path.Combine(sdCardPath, "imagen.png");
var stream = new FileStream(filePath, FileMode.Create);
img.Compress(Bitmap.CompressFormat.Png, 100, stream);
stream.Close();
Where img is the bitmap.
I have already enabled the permissions with:
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
But still not let me save on that route, any suggestions?