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.....

Code
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

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

create dir
Directory.CreateDirectory(pathToNewFolder);
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...

Answers

Sign In or Register to comment.