Skip to content

Most visited

Recently visited

navigation

使用系统权限

设计模式

权限

为了保护系统的完整性和用户隐私权,Android 在访问受限的沙盒中运行每款应用。如果应用需要使用其沙盒以外的资源或信息,则必须明确请求权限。根据应用请求的权限类型,系统可能会自动授予权限,也可能会要求用户授予权限。

本课程将向您介绍如何为您的应用声明和请求权限。

课程

声明权限
学习如何在您的应用清单中声明需要的权限。
在运行时请求权限
学习如何在应用运行时请求用户授予权限。本课程仅适用于运行 Android 6.0(API 级别 23)及更高版本的设备上的应用。
权限最佳做法
有关在请求和使用权限方面营造最佳用户体验的指南。
This site uses cookies to store your preferences for site-specific language and display options.

Get the latest Android developer news and tips that will help you find success on Google Play.

* Required Fields

Hooray!

Follow Google Developers on WeChat

Browse this site in ?

You requested a page in , but your language preference for this site is .

Would you like to change your language preference and browse this site in ? If you want to change your language preference later, use the language menu at the bottom of each page.

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

Take a short survey?
Help us improve the Android developer experience.
(Sep 2017 survey)