C
C#2y ago
kilyion

❔ Pictures Folder in android Maui

I found out how to fetch the path of the Pictures Folder in the Files app of my devices (here an Android tablet with Android 12.1 and API 32) And now I'm trying to create a folder called "MyApp" in Pictures where all the pictures taken from my project app will be stored. Here's a sample of my work :
1 - var picturesDirectory = System.Environment.GetFolderPath(System.Environment.SpecialFolder.MyPictures);
2 - var newDirectory = Path.Combine(picturesDirectory, "MyApp");
3 - Directory.CreateDirectory(newDirectory);
4 - await DisplayAlert("Alert", picturesDirectory + Environment.NewLine + newDirectory , "OK");
1 - var picturesDirectory = System.Environment.GetFolderPath(System.Environment.SpecialFolder.MyPictures);
2 - var newDirectory = Path.Combine(picturesDirectory, "MyApp");
3 - Directory.CreateDirectory(newDirectory);
4 - await DisplayAlert("Alert", picturesDirectory + Environment.NewLine + newDirectory , "OK");
1 - I'm fetching the path of the Pictures Folder 2 - I combine the path retrieved with the name of the folder i want to create into a new path 3 - With this new path i create a new Directory 4 - I'm just checking if the two directory that I use have the same beginning The sample code is from a void and when I trigger it with a button click it does the steps 1, 2 and 4 but not 3 The problem is that my folder "MyApp" is not created in the Files App of my devices
1 Reply
Accord
Accord2y ago
Looks like nothing has happened here. I will mark this as stale and this post will be archived until there is new activity.