动态的Andr​​oidManifest.xml [英] Dynamic AndroidManifest.xml

查看:198
本文介绍了动态的Andr​​oidManifest.xml的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以动态定义的Andr​​oidManifest.xml方面?例如,是否可以注册或编辑的活动,服务和接收器的定义上的苍蝇,用Java code?

Is it possible to dynamically define aspects of the AndroidManifest.xml? For example, is it possible to register or edit the definition of activities, services and receivers on the fly, using Java code?

如果这样,是否有在哪里这个code应该放在什么限制?还有什么可以动态定义的?

If so, are there any limitations on where this code should be placed? What else can be dynamically defined?

推荐答案

我相信大多数可用的操作都是由的软件包管理系统文档

I believe most of the available operations are described by the PackageManager documentation

您可以添加和删除权限(<一个href=\"http://developer.android.com/reference/android/content/pm/PackageManager.html#addPermission%28android.content.pm.PermissionInfo%29\"相对=nofollow> addPermission()),你可以启用或禁用与组件(服务,接收器等)<一个href=\"http://developer.android.com/reference/android/content/pm/PackageManager.html#setComponentEnabledSetting%28android.content.ComponentName,%20int,%20int%29\"相对=nofollow> setComponentEnabledSetting()。

You can add and remove permissions (addPermission()) and you can enable or disable components (services, receivers etc.) with setComponentEnabledSetting().

这篇关于动态的Andr​​oidManifest.xml的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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