It seems PhoneGap generates that file automatically when config.xml
is modified.
I wish to add Ad network\'s activities, services, etc in AndroidM
You probably want to check out cordova-custom-config.
It supports many extra settings in the cordova config.xml
to customise the AndroidManifest.xml
.
I'm using it to change the android:configChanges
setting (adding uiMode
to stop it from reloading when docking/undocking) and it works great.
The cordova-custom-config github page shows a full example with all supported options so it's very easy to setup.
Nowadays in Cordova, we can use <config-file> and <edit-config> in our config.xml
to make simple custom changes to AndroidManifest.xml
.
Examples copied from the docs:
<config-file target="AndroidManifest.xml" parent="/manifest/application">
<activity android:name="com.foo.Foo" android:label="@string/app_name">
<intent-filter>
</intent-filter>
</activity>
</config-file>
<edit-config file="AndroidManifest.xml" target="/manifest/uses-sdk" mode="merge">
<uses-sdk android:minSdkVersion="16" android:maxSdkVersion="23" />
</edit-config>
<edit-config file="AndroidManifest.xml" target="/manifest/application/activity[@android:name='MainActivity']" mode="overwrite">
<activity android:name="MainActivity" android:label="NewLabel" android:configChanges="orientation|keyboardHidden" />
</edit-config>
Note: to use the android:
namespace in your config.xml
, you need to add xmlns:android="http://schemas.android.com/apk/res/android"
to the root <widget>
element.
Typically this is found in the "res" directory ( - src - gen [Generated Java Files] - Android - Android Dependencies - Referenced Libraries - assets - bin - libs - res - AndroidManifest.xml - proguard-project.txt - project.properties) of course this is depending on what version of Cordova you are using. Typically most of these things are specified in the config.xml for newer Phonegap builds from my understanding which is why you don't need to include an AndroidManifest.xml file when using Phonegap Build. I would recommend trying Configap to edit the main config.xml and see if any of the settings/services you need to access are options. Configap can be found here!
forgot to mention I use Notepad++ to edit my .xml on the fly but you can also open in the sdk
Phonegap uses config.xml to create androidmanifest.xml when you add the android platform to a project. It is also modified when you add plugins and build the project (for example, it adds the required permission for the plugin).
But you can also manually edit the file in platforms/android/AndroidManifest.xml
to add permissions, configure the activity or the application... it will not be lost when you rebuild your project.