用途,权限和权限标签在AndroidManifest.xml中的Diffrences [英] Diffrences between Uses-Permission and Permissions tag in AndroidManifest.xml

查看:219
本文介绍了用途,权限和权限标签在AndroidManifest.xml中的Diffrences的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

的区别是什么用途,权限权限 AndroidManifest.xml中。 我理解,因为它是用来从我们的应用程序访问互联网,地点使用,允许标记。但我不明白的时候,为什么我们应该使用权限标签中的清单的文件,什么是的差异采用-许可

在此先感谢,

解决方案

引述文档

  

要执行自己的权限,   首先必须声明它们在你的   的Andr​​oidManifest.xml 使用一个或多个   <许可> 标签。例如,希望控制谁一个应用程序可以就它的活动之一可以宣布一许可用于此操作如下:

 <舱单的xmlns:机器人=htt​​p://schemas.android.com/apk/res/android
    包=com.me.app.myapp>

    <允许机器人:名称=com.me.app.myapp.permission.DEADLY_ACTIVITY
        机器人:标签=@字符串/ permlab_deadlyActivity
        机器人:说明=@字符串/ permdesc_deadlyActivity
        机器人:permissionGroup =android.permission,group.COST_MONEY
        安卓的ProtectionLevel =危险/>

< /舱单>
 

因此​​,<使用-许可> 是当你的应用程序正在寻求使用某些功能,用户的权限,而<许可> 是当你的应用程序需要其他应用程序寻求利用你的一些功能,用户的权限。

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.

Thanks in Advance,

解决方案

Quoting the documentation:

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>

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中的Diffrences的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆