是否可以将代码包含/导入到 Android Manifest 中?
我正在开发一个供其他 Android 应用程序使用的包,当它们导入 .jar 时,它们还需要向 Android 清单添加合理的权限块等。 是否可以将这些必需的权限、意图过滤器等与包捆绑在一起,并在构建时使用清单中的一行将它们全部导入到清单中?与仅提供一段代码以从包网站复制并粘贴到清单中相比。 我觉得如果捆绑了权限,这将使导入其他包(一个例子是谷歌分析)变得更加容易,并且类似于
的东西是唯一的需要投入的线路。
任何关于这是否可能的提示都会很棒, 谢谢
I am working on a package for other android applications to use, and when they import the .jar, they also need to add a reasonable chunk of permissions and such to the android manifest.
Is it possible to have these required permissions, intent filters and such bundled with the package, and just have them all imported into the manifest at build time with a single line in the manifest? in comparison to just providing a chunk of code to copy and paste into the manifest from the package website.
I feel that this would make importing other packages (one example would be google analytics) much easier if the permissions were bundled, and something along the lines of <import package.name.manifest>
was the only required line to throw in.
Any heads up as to whether this is possible would be awesome,
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是的,从 SDK 工具修订版 20(2012 年 6 月)开始,现在可以了。来自发行说明:
有关用法示例,请参阅在 Android 中使用新的“manifestmerger”属性。
Yes, it is now possible as of Revision 20 of the SDK Tools (June 2012). From the release notes:
For example usage, see Using the new "manifestmerger" property in Android.