许可(permissions)
可以使用Xamarin或Visual Studio内置的工具在Android清单文件中添加许可。应该只给应用程序设置必须的访问许可,因为用户从Google Play下载应用程序时会提示所需许可。
本文讲解如何在Visual Studio或Xamarin中设置许可,应该同Adding Permissions to Android Manifest一起阅读。
You can use the tooling supportbuilt into Xamarin Studio or 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 downloadyour application from Google Play.
This document describes how to add permissions in Visual Studio and Xamarin Studio and should be read in conjunction with the Adding Permissions to Android Manifestrecipe.
使用Visual Studio
l 在解决方案管理器中双击Properties,在Properties窗口选择Android Manifest标签。
l 如果应用程序还没有创建AndroidManifest.xml,点击No AndroidManifest.xml found.Click to add one:
Double-click on Properties in the Solution Explorer and select the Android Manifest tab in the
Properties window.
If the application does not already have an AndroidManifest.xml, click No AndroidManifest.xml found. Click to add one as shown below:
l 在Required permissions列表给应用程序添加需要的许可:
Select any permissions your application needs from the Required permissions list and save:
使用 Xamarin Studio
l 在解决方案面板双击项目,选择Options > Build > Android Application
l 如果项目还没有创建AndroidManifest.xml文件,点击Add Android Manifest按钮
Double-click on the project in the Solution Pad and select Options > Build > Android Application. Click the Add Android Manifest button if the project does not already have an AndroidManifest.xml.
l 在列表中选择应用程序所需授权,点击OK按钮:
Select any permissions your application needs from the Required permissions list and click OK: