简体   繁体   中英

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

I want to add these lines to the AndroidManifest.xml file

      <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 ?

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. As part of this, we obfuscate management of the platform configuration files – namely your Android Manifest and your iOS Property List. We configure these files based on the preferences you specify in your app's config.xml file. 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. 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).

Find out more on: Customize your Android manifest and iOS Property list on Phonegap build

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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