简体   繁体   English

Android Manifest File的许可

[英]permission of Android Manifest File

Can we give the permission of the android manifest file in the java file. 我们可以在java文件中授予android清单文件的权限吗? if we want to take the permission of internet() in our application ,so can we give it in the java file. 如果我们想在我们的应用程序中获取internet()的权限,那么我们可以在java文件中提供它。

No. The requested permissions are also used to show to you in the market for example, it would be strange if you could later on add internet permissions to the program. 不会。例如,所请求的权限也用于向您展示市场,如果您以后可以向该程序添加Internet权限,那将会很奇怪。

You either need the permission (even if it is only once/sometimes) or you don't. 您需要获得许可(即使只有一次/有时),或者您不需要。 And you need to specify that in the XML. 您需要在XML中指定它。 There is no valid reason to even want to do so in the code: if you need internet, you need to request the permission. 没有正当理由甚至想在代码中这样做:如果你需要互联网,你需要申请许可。 It's as simple as that :) 就这么简单 :)

Its a thumb rule in android.......... Any permission needed, is to be specified in the AndroidManifest.xml file. 它是android中的拇指规则..........需要的任何权限,都要在AndroidManifest.xml文件中指定。 Android manifest configure, install, and runs the App... Its a centralized location to check various parameters of the app. Android清单配置,安装和运行应用程序...它是一个集中位置,用于检查应用程序的各种参数。

不,你不能这样做,因为所有文件和文件夹都在初始化时初始化,所以你不能在运行时或其他来源更改任何类型的文件和文件夹

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM