Ionic Structure - Config.xml

I need to modify my config.xml file, so when compiling for Android I take these permissions:

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

      

I did it like this, in config.xml:

<platform name="android">
    <icon src="resources\android\icon\drawable-ldpi-icon.png" density="ldpi"/>
    <icon src="resources\android\icon\drawable-mdpi-icon.png" density="mdpi"/>
    <icon src="resources\android\icon\drawable-hdpi-icon.png" density="hdpi"/>
    <icon src="resources\android\icon\drawable-xhdpi-icon.png" density="xhdpi"/>
    <icon src="resources\android\icon\drawable-xxhdpi-icon.png" density="xxhdpi"/>
    <icon src="resources\android\icon\drawable-xxxhdpi-icon.png" density="xxxhdpi"/>
    <splash src="resources\android\splash\drawable-land-ldpi-screen.png" density="land-ldpi"/>
    <splash src="resources\android\splash\drawable-land-mdpi-screen.png" density="land-mdpi"/>
    <splash src="resources\android\splash\drawable-land-hdpi-screen.png" density="land-hdpi"/>
    <splash src="resources\android\splash\drawable-land-xhdpi-screen.png" density="land-xhdpi"/>
    <splash src="resources\android\splash\drawable-land-xxhdpi-screen.png" density="land-xxhdpi"/>
    <splash src="resources\android\splash\drawable-land-xxxhdpi-screen.png" density="land-xxxhdpi"/>
    <splash src="resources\android\splash\drawable-port-ldpi-screen.png" density="port-ldpi"/>
    <splash src="resources\android\splash\drawable-port-mdpi-screen.png" density="port-mdpi"/>
    <splash src="resources\android\splash\drawable-port-hdpi-screen.png" density="port-hdpi"/>
    <splash src="resources\android\splash\drawable-port-xhdpi-screen.png" density="port-xhdpi"/>
    <splash src="resources\android\splash\drawable-port-xxhdpi-screen.png" density="port-xxhdpi"/>
    <splash src="resources\android\splash\drawable-port-xxxhdpi-screen.png" density="port-xxxhdpi"/>

     <preference name="android-minSdkVersion" value="10" />
    <preference name="android-targetSdkVersion" value="21" />

    <config-file target="AndroidManifest.xml" parent="/*"> 
        <supports-screens 
            android:anyDensity="true" 
            android:largeScreens="true" 
            android:normalScreens="true" 
            android:resizeable="true" 
            android:smallScreens="true" 
            android:xlargeScreens="true" />
        <uses-permission android:name="android.permission.INTERNET" />
        <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />    

        <application 
            android:hardwareAccelerated="true" 
            android:icon="@drawable/icon" 
            android:label="@string/app_name" 
            android:supportsRtl="true">

            <activity 
                android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale" 
                android:label="@string/activity_name" 
                android:launchMode="singleTop" 
                android:name="MainActivity" 
                android:theme="@android:style/Theme.Black.NoTitleBar"
                 android:windowSoftInputMode="adjustResize">

                <intent-filter android:label="@string/launcher_name">
                    <action android:name="android.intent.action.MAIN" />
                    <category android:name="android.intent.category.LAUNCHER" />
                </intent-filter>
            </activity>
        </application>
    </config-file>

  </platform>

      

But then when creating the manifest there is only permission INTERNET

, not ACCESS_NETWORK_STATE

.

1. Is it wrong? Do I have to add the permission manually in AndroidManifest.xml?

And one more request:

2. How to specify a value for the "launcher_name" string? You can change it in string.xml, but when compiling the default steps.

+3


source to share


1 answer


  • There should be no harm in just adding it manually to AndroidManifest.xml, so this is probably your best bet.


For 1 and 2, just for confirmation, are you editing the config.xml file that is at the heart of your project? There is another one that is created in the / android / res / xml platform, which you should not edit as it will always be replaced.

+1


source







All Articles