Android 官方文档:(二)应用清单 —— 2.26 <uses-permission>标签

syntax:
<uses-permission android:name="string"
        android:maxSdkVersion="integer" />
contained in:
<manifest>
description:
Requests a permission that the application must be granted inorder for it to operate correctly. Permissions are granted by the user when the application is installed, not while it‘s running.

For more information on permissions, see the Permissions section in the introduction and the separate Security and Permissions document. A list of permissions defined by the base platform can be found at android.Manifest.permission.

attributes:
android:name
The name of the permission. It can be a permission defined by the application with the <permission> element, a permission defined by another application, or one of the standard system permissions, such as "android.permission.CAMERA" or "android.permission.READ_CONTACTS". As these examples show, a permission name typically includes the package name as a prefix.
android:maxSdkVersion
The highest API level at which this permission should be granted to your app.Setting this attribute is useful if the permission your app requires is no longer needed beginningat a certain API level.

For example, beginning with Android 4.4 (API level 19), it‘s no longer necessary for your appto request the WRITE_EXTERNAL_STORAGE permission when yourapp wants to write to its own application-specific directories on external storage (the directoriesprovided by getExternalFilesDir()). However,the permission is required for API level 18 and lower. So you can declare that thispermission is needed only up to API level 18 with a declaration such as this:

<uses-permission
     android:name="android.permission.WRITE_EXTERNAL_STORAGE"
     android:maxSdkVersion="18" />

This way, beginning with API level 19, the system will no longer grant your app theWRITE_EXTERNAL_STORAGE permission.

introduced in:
API Level 1
see also:

Android 官方文档:(二)应用清单 —— 2.26 &lt;uses-permission&gt;标签

时间: 2024-08-09 02:04:56

Android 官方文档:(二)应用清单 —— 2.26 &lt;uses-permission&gt;标签的相关文章

Android 官方文档:(二)应用清单 —— 2.2 &amp;lt;action&amp;gt;标签

syntax: <action android:name="string" /> contained in: <intent-filter> description: Adds an action to an intent filter.An <intent-filter> element must contain one or more <action> elements. If it doesn't contain any, noIn

Android官方文档之App Resources(中)

本文将继续介绍App Resources中的资源类型(Animation.Color State List.String.Style). 如果需要了解Android中的资源规范,您可以访问我翻译的这篇官方文档:<Android官方文档之App Resources(上)>. 如需访问官方原文,您可以点击这个链接:<Resource Types>. 在下一篇文章中(Android官方文档之App Resources(下)),将介绍App Resources中其余的资源类型(Layout

Android官方文档之App Components(Activities)

Activity是Android四大组件之首,本文将介绍Activity的含义.创建.启动.销毁.生命周期 等. 如需访问官方原文,您可以点击这个链接:<Activities> Activities Activity是一个类,它是Android呈现界面的载体,用于与用户操作交互,如拨号.照相.发送邮件.展示地图 等.每个Activity都承载了一个Window,这个Window用来绘制UI(User Interface).一般情况下,该Window铺满(fill)整个屏幕:有时候,它也可以悬浮

【android官方文档】与其他App交互

发送用户到另外一个App YOU SHOULD ALSO READ 内容分享 One of Android's most important features is an app's ability to send the user to another app based on an "action" it would like to perform. For example, if your app has the address of a business that you'd

Android官方文档之App Components(Common Intents)

Intent的真正强大之处在于它的隐式Intent,隐式Intent需要配合Intent-filters使用,有关这方面的概念和知识,您可以参考我翻译的官方文档:<Android官方文档之App Components(Intents and Intent Filters)>. 隐式Intent足够强大,以至于系统提供了大量的Intent方便开发者启动系统应用程序,本文将介绍一些常用的隐式Intent.以及如何自定义intent-filters以匹配隐式intent. 如需阅读官方原文,您可以点

Android 官方文档:(一)动画和图像 —— 1.5 画布和画图

The Android framework APIs provides a set 2D drawing APIs that allow you to render your owncustom graphics onto a canvas or to modify existing Views to customize their look and feel.When drawing 2D graphics, you'll typically do so in one of two ways:

Android官方文档之App Resources(下)

本文将介绍Android中Resource Types的drawable.menu.layout.如需访问官方原文,您可以点击这些链接: <Drawable Resources> <Layout Resource> <Menu Resource> 如需了解Android中的其他资源介绍(Animation.Color State List.String.Style),您可以点击这个链接:<Android官方文档之App Resources(中)>. 布局资源

【Android官方文档】翻译Android官方文档-Activities(一)

Activity是可以给用户提供交互操作的程序组件,例如打电话,拍照,发送邮件,抑或者是显示地图.通常窗口会填满屏幕,但是也可以做到比屏幕小或者是悬浮在窗口顶部. App通常由多个Activities组成,它们之间支持相互跳转.一般情况下,每个Activity在应用中都是特别的,就好像 主Activity一样,主activity是应用第一个Activity,其他Activity可以通过其他操作启动.一个新的Activity的启动,那么旧Activity就会被停止,但是系统会保存这些activit

Android官方文档training中英文翻译目录大全:29篇已翻译,45篇未翻译

Android官方文档training中英文翻译目录大全:29篇已翻译,45篇未翻译 1. Getting Started Building Your First App: 原文: https://developer.android.com/training/basics/firstapp/index.html译文:http://wiki.eoeandroid.com/Building_Your_First_AppAdding the Action Bar:原文:https://develope