![](/img/trans.png)
[英]Cordova/Phonehap - get app version number from config.xml
[英]Can I write configuration from config.xml to AndroidManifest.xml in cordova applications
我想将这些行添加到AndroidManifest.xml文件中
<application ... >
.....
.....
<service android:name="com.red_folder.phonegap.plugin.backgroundservice.sample.MyService">
<intent-filter>
<action android:name="com.red_folder.phonegap.plugin.backgroundservice.sample.MyService" />
</intent-filter>
</service>
</application>
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
有没有办法从config.xml文件添加这些行?
如果是,最好的方法是什么?
您可以:
PhoneGap Build旨在消除配置SDK和编译本机应用程序的麻烦,因此您可以专注于编写出色的代码。 在此过程中,我们会混淆对平台配置文件(即您的Android清单和iOS属性列表)的管理。 我们根据您在应用程序的config.xml文件中指定的首选项配置这些文件。 但是,这些xml文件的规范在不断变化,因此我们不可能通过使用简单的首选项来公开所有可能的配置。 因此,对于那些我们没有涉及的情况,我们现在使您能够通过gap:config-file元素(测试版功能)将xml直接添加到Android Manifest和iOS Propertly List文件中。
了解更多信息: 在Phonegap构建上自定义您的Android清单和iOS属性列表
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.