I've tried several folders but looks like no file is created. External read & write permission have been enabled. The code run without any sign of error. (as given below) Here is the screenshot of the code inside mainactivity.cs (this is for testing purposes). I also assume that since this is platform specific, the code must be in android project.
string filename = Path.Combine(Xamarin.Essentials.FileSystem.AppDataDirectory, "count1.txt") ; StreamWriter sw = File.CreateText(filename); sw.WriteLine("asad ini test"); sw.Close();enter code here
1b. I 'm using Android 6.0 phone, but I can't find such folder /data/user... (I'm not sure if such folder is targeted special version of Android)
I search both internal /Android/myproject/files/ and found nothing I search external SDcard /Android/myproject/files/ and still found nothing (please look at the my android phone folders, i can't even find /data folder
Once, this is accomplished the next step would be how to call this function from the generalproject (non android, non IOS, non UWP project).
Example to write file given in xamarin document. Where should this code reside? in general project folder ? or, android project folder?