简体   繁体   English

何时使用清单元数据标签的示例

[英]Examples of when to use the manifest meta-data tag

What should the meta-data tag in the Android Manifest be used for? Android Manifest中的meta-data标签应用于什么? http://developer.android.com/guide/topics/manifest/meta-data-element.html http://developer.android.com/guide/topics/manifest/meta-data-element.html

Is the meta-data field publicly accessible (ie can app A view the manifest meta-data of app B)? 元数据字段是否可以公开访问(即,应用A可以查看应用B的清单元数据)吗?

What should the meta-data tag in the Android Manifest be used for? Android Manifest中的meta-data标签应用于什么?

Sometimes, that is for when a library needs some configuration data, as an alternative to your having to provide that data in Java. 有时,这是在库需要一些配置数据的情况下进行的,以替代您必须用Java提供该数据的方法。 For example, FileProvider (from the Android Support libraries) uses this to configure what files it can serve. 例如, FileProvider (来自Android支持库)使用它来配置它可以提供的文件。

Sometimes, this will be used by bits of the Android framework, such as app widgets and device administrators. 有时,Android框架的某些部分会使用它,例如应用程序小部件和设备管理员。

Is the meta-data field publicly accessible 元数据字段是否可以公开访问

Yes, this data is public, through PackageManager . 是的,此数据是通过PackageManager公开的。

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

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