VISUAL STUDIO   Windows Mac

Permissions

PDF for offline use
Related Recipes:

Let us know how you feel about this

Translation Quality


0/250

last updated: 2017-04

You can use the tooling support built into Visual Studio to create and add permissions to the Android Manifest. You should only request permissions that your application requires to run, as users will be prompted to allow these permissions when they download your application from Google Play.

This document describes how to add permissions in Visual Studio and should be read in conjunction with the Adding Permissions to Android Manifest recipe.

  1. Double-click Properties in the Solution Explorer and select the Android Manifest tab in the Properties window:

    Required permissions in the Android Manifest tab

  2. If the application does not already have an AndroidManifest.xml, click No AndroidManifest.xml found. Click to add one as shown below:

    No AndroidManifest.xml message

  3. Select any permissions your application needs from the Required permissions list and save:

    Example CAMERA permissions selected

Note that Debug builds automatically set some permissions to make debug easier (such as INTERNET and READ_EXTERNAL_STORAGE), but these automatically-set permissions will not appear to be enabled in the Required permissions list. Release builds, however, use only the permissions that you explicitly set in the Required permissions list. If you find that switching to a Release build causes your app to lose a permission that was available in the Debug build, verify that you have explicitly enabled this permission in the Required permissions list as described above.

You can use the tooling support built into Xamarin Studio to create and add permissions to the Android Manifest. You should only request permissions that your application requires to run, as users will be prompted to allow these permissions when they download your application from Google Play.

This document describes how to add permissions in Xamarin Studio and should be read in conjunction with the Adding Permissions to Android Manifest recipe.

  1. Double-click the project in the Solution Pad and select Options > Build > Android Application:

    Required Permissions section shown

  2. Click the Add Android Manifest button if the project does not already have an AndroidManifest.xml:

    The project's Android manifest is missing

  3. Select any permissions your application needs from the Required permissions list and click OK:

    Example Camera permissions selected

Note that Debug builds automatically set some permissions to make debug easier (such as Internet and ReadExternalStorage), but these automatically-set permissions will not appear to be enabled in the Required permissions list. Release builds, however, use only the permissions that you explicitly set in the Required permissions list. If you find that switching to a Release build causes your app to lose a permission that was available in the Debug build, verify that you have explicitly enabled this permission in the Required permissions list as described above.

Xamarin Workbook

If it's not already installed, install the Xamarin Workbooks app first. The workbook file should download automatically, but if it doesn't, just click to start the workbook download manually.