Forum Xamarin Xamarin.Android

Creating public folder/directory on sdcard

Jingo21Jingo21 Member ✭✭

Sorry for asking a question that has probably been ask millions of times...

I'm trying to create a folder/directory on sdcard that I can view with Windows Explorer on PC

This is what I've tried so far.....

Android manifest

after running runtime permission
if (CheckSelfPermission(Android.Manifest.Permission.WriteExternalStorage) == Permission.Granted)
when checking phone settings=>apps=>app the storage permission is checked

Check media state
string state = Android.OS.Environment.ExternalStorageState;
Media state => Mounted - sdcard present and can read/write to sdcard

var pathToNewFolder = Android.OS.Environment.ExternalStorageDirectory.AbsolutePath + "/MyFolder";
Returned file path => /STORAGE/EMULATED/0/MYFOLDER

create dir
If I check in windows explorer the folder MYFOLDER is not there.

Somewhere I'm missing something and I've been Googling no for days with out luck...


Sign In or Register to comment.