简体   繁体   English

我可以在Cordova应用程序中将配置从config.xml写入AndroidManifest.xml吗?

[英]Can I write configuration from config.xml to AndroidManifest.xml in cordova applications

I want to add these lines to the AndroidManifest.xml file 我想将这些行添加到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" />

Is there a way to add these lines from the config.xml file ? 有没有办法从config.xml文件添加这些行?

If yes how else what is the best way ? 如果是,最好的方法是什么?

You can: 您可以:

PhoneGap Build aims to take away the pains of configuring SDKs and compiling native applications so you can focus on writing great code. PhoneGap Build旨在消除配置SDK和编译本机应用程序的麻烦,因此您可以专注于编写出色的代码。 As part of this, we obfuscate management of the platform configuration files – namely your Android Manifest and your iOS Property List. 在此过程中,我们会混淆对平台配置文件(即您的Android清单和iOS属性列表)的管理。 We configure these files based on the preferences you specify in your app's config.xml file. 我们根据您在应用程序的config.xml文件中指定的首选项配置这些文件。 However, the specifications of these xml files are constantly changing, and it would be impossible for us to expose all of the possible configurations through the use of simple preferences. 但是,这些xml文件的规范在不断变化,因此我们不可能通过使用简单的首选项来公开所有可能的配置。 So for those cases that we haven't covered, we're now enabling you to contribute xml directly to your Android Manifest and iOS Propertly List files, via the gap:config-file element (beta feature). 因此,对于那些我们没有涉及的情况,我们现在使您能够通过gap:config-file元素(测试版功能)将xml直接添加到Android Manifest和iOS Propertly List文件中。

Find out more on: Customize your Android manifest and iOS Property list on Phonegap build 了解更多信息: 在Phonegap构建自定义您的Android清单和iOS属性列表

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

相关问题 Cordova / Phonehap-从config.xml获取应用程序版本号 - Cordova/Phonehap - get app version number from config.xml 科尔多瓦:在config.xml中使用环境变量 - Cordova: Use environment variables in config.xml 我可以使用哪个config.xml? - which config.xml do I work with? 在meteor app中如何在cordova config.xml中添加orgin = *? - In meteor app how to add orgin=* in cordova config.xml? 科尔多瓦:如何设置特定于平台的config.xml文件,科尔多瓦构建后该文件不会被覆盖? - Cordova: How to set Platform-specific config.xml file which is not overwritten after cordova build? 我在哪里找到了 React Native Expo 文件中的 AndroidManifest.xml 文件? - Where did i find AndroidManifest.xml file in React Native Expo file? 从androidmanifest.xml中删除了SMS权限,但仍然出现在manifest.class上 - SMS permissions removed from androidmanifest.xml but still appear on manifest.class 我的AndroidManifest.xml中是否有阻止外部JS和CSS加载的内容? - Is there anything in my AndroidManifest.xml preventing external JS and CSS from loading? Adobe Phonegap图标,无config.xml文件 - Adobe Phonegap Icons, no config.xml file 使用环境变量/参数化config.xml - Using environment variables / parameterizing config.xml
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM