How to get the folder with the folder of the Android Mono Xamarin application?

Mono (Xamarin) Android application path, how to get? I found one way, it looked better than I found

string path = ""; System.Collections.IDictionary vars = System.Environment.GetEnvironmentVariables(); foreach (System.Collections.DictionaryEntry entry in vars) { if (entry.Key.ToString().Contains("HOME")) path = entry.Value.ToString(); } 
+5
source share
2 answers

In the Android app you can use:

 // Documents folder string documentsPath = System.Environment.GetFolderPath( System.Environment.SpecialFolder.Personal); 

This will give you the way:

 /data/data/YourAppName/files/ 
+9
source

I think this is what you need. Give local root files.

 Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData 

and when you need to get the full file name, you can do something like this:

 string _fileName = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "filename.txt"); 
0
source

All Articles