Search code examples
androidxamarinpackageusing

Why are some packages inaccessible in Xamarin Android app?


I've inherited a Xamarin Android app, and I'm not fully familiar with the way it works. For a class I'm creating, I want to use the packages Android.Content and System.Environment, however neither are available (when I start typing they don't show up in the code completion dropdown).

I'm wondering what determines the available packages for an application, and how to make more available?


Solution

  • Okay it took me a while to find this information, even though it's probably common knowledge.

    To add packages, in Xamarin, right-click on the "References" directory under your project and select "Manage References". Then from this dialog, select whatever package that you need to add.