string mainDir = System.IO.Path.Combine(FileSystem.Current.AppDataDirectory,"logs");
if (!Directory.Exists(mainDir))
{
Directory.CreateDirectory(mainDir);
}
I am trying to create folder to save log txt file in my project application directory i am writing below code but its not showing any file or folder
mainDir return this below path " /data/user/0/com.xxx.xxx/files/logs" when i see the applications directory it is having only cache directory not creating logs directory. can you help anything wrong.
Actually, you have created the directory successfully. It didn't show because the directory with path
Path.Combine(FileSystem.AppDataDirectory, filename)can't be found by the Android System File Manager.But you can find it with the Android Studio's Device File Explorer. In addition, you can try to check if the directory is created or not by the following code: