Monodroid Environment variables

后端 未结 2 895
野趣味
野趣味 2021-02-09 17:20

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

相关标签:
2条回答
  • 2021-02-09 17:36

    Turns out this isn't available in iOS or Windows phone.

    http://docs.xamarin.com/guides/cross-platform/application_fundamentals/building_cross_platform_applications/part_4_-_platform_divergence_abstraction_divergent_implementation (see section 3.1.4).

    0 讨论(0)
  • 2021-02-09 17:52

    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"
    
    0 讨论(0)
提交回复
热议问题