How get Mono Xamarin Android app path folder?
17,108
Solution 1
In your Android application you could use:
// Documents folder
string documentsPath = System.Environment.GetFolderPath(
System.Environment.SpecialFolder.Personal);
This will get you the path:
/data/data/YourAppName/files/
Solution 2
I think this is what you need. Give the local files root.
Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData
and when you need get a file's full name you can do something like this:
string _fileName = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "filename.txt");
Author by
vitalinvent
Updated on July 23, 2022Comments
-
vitalinvent almost 2 years
Mono (Xamarin) Android application path, how do get? I found one way, it look like better 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(); }