AndroidManifest.xml中Uses-Permission和Permissions标签之间的区别 [英] Differences between Uses-Permission and Permissions tag in AndroidManifest.xml
问题描述
AndroidManifest.xml 中的 Uses-Permission
和 Permissions
标记之间有什么区别?我理解 uses-permission
标记,因为它用于从我们的应用程序访问Internet,位置.但是我不明白我们何时,为什么在清单文件中使用权限标记,它与 uses-permission
有什么区别.
What is the difference between Uses-Permission
and Permissions
tag in AndroidManifest.xml .
I understood uses-permission
tag as it is used to access Internet,Location from our application. But I did not understand when and why should we use permissions tag in Manifest file and what is its difference from uses-permission
.
推荐答案
引用文档:
要实施自己的权限,您可以首先必须在您的网站中声明它们
AndroidManifest.xml
使用一个或多个< permission>
标签.例如,想要控制谁可以开始其活动之一的应用程序可以声明此操作的权限,如下所示:
To enforce your own permissions, you must first declare them in your
AndroidManifest.xml
using one or more<permission>
tags. For example, an application that wants to control who can start one of its activities could declare a permission for this operation as follows:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.me.app.myapp" >
<permission android:name="com.me.app.myapp.permission.DEADLY_ACTIVITY"
android:label="@string/permlab_deadlyActivity"
android:description="@string/permdesc_deadlyActivity"
android:permissionGroup="android.permission-group.COST_MONEY"
android:protectionLevel="dangerous" />
</manifest>
因此,< uses-permission>
是在您的应用程序正在寻求用户使用某些功能的许可时,而< permission>
是在您的应用程序需要时其他应用程序以征求用户的许可以使用您的某些功能.
Hence, <uses-permission>
is when your application is seeking the user's permission to use some feature, while <permission>
is when your application is requiring other apps to seek the user's permission to use some feature of yours.
这篇关于AndroidManifest.xml中Uses-Permission和Permissions标签之间的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!