Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Monodroid Environment variables

In Android there are a collection of Environment paths available at Android.OS.Environment. However, when keeping cross platform capabilities in mind, I want to store pictures in a pictures folder and so thought to use System.Environment.GetFolderPath instead. However, my question is where these all point to in an Android environment. Can I get a useful pictures folder from the following?

string path = Environment.GetFolderPath (Environment.SpecialFolder.MyPictures);
like image 788
Dave W Avatar asked Jun 04 '13 12:06

Dave W


People also ask

How do I set environment variables in Visual Studio?

To access this page, select a project node in Solution Explorer, select Project > Properties from the Visual Studio menu, and then select the Environment Variables tab. Specifies the name of an environment variable that will be used when the project is built or when the project is run from Visual Studio.

Which method is used to set the value of and environment variable?

The SetEnvironmentVariable(String, String, EnvironmentVariableTarget) method lets you define an environment variable that is available to the current process (the Process value). Environment variables that are unique to the current process environment block persist only until the process ends.


1 Answers

After stepping through some code, I've summarised the locations given by Xamarin Android for each of the different System.Environment variables below. I don't have an iOS project available, but if anyone could post the iOS equivalents I'd be grateful.

ApplicationData         "/data/data/ProjectName.ProjectName/files/.config"
CommonApplicationData   "/usr/share"
CommonProgramFiles      ""
Cookies                 ""
Desktop                 "/data/data/ProjectName.ProjectName/files/Desktop"
DesktopDirectory        "/data/data/ProjectName.ProjectName/files/Desktop"
Favorites               ""
History                 ""
InternetCache           ""
LocalApplicationData    "/data/data/ProjectName.ProjectName/files/.local/share"
MyComputer              ""
MyDocuments             "/data/data/ProjectName.ProjectName/files"
MyMusic                 "/data/data/ProjectName.ProjectName/files/Music"
MyPictures              "/data/data/ProjectName.ProjectName/files/Pictures"
MyVideos                "/data/data/ProjectName.ProjectName/files/Videos"
Personal                "/data/data/ProjectName.ProjectName/files"
ProgramFiles            ""
Programs                ""
Recent                  ""
SendTo                  ""
StartMenu               ""
Startup                 ""
System                  ""
Templates               "/data/data/ProjectName.ProjectName/files/Templates"
like image 164
Dave W Avatar answered Nov 07 '22 09:11

Dave W