50676

Ionic framework - Config.xml

Question:

I need to modify the 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 this way, 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 generating manifest has only the INTERNET permission, not ACCESS_NETWORK_STATE.

<strong>1.</strong> Is that wrong? Must I add the permission manually to the AndroidManifest.xml?

And another query:

<strong>2.</strong> How do I indicate the value for the string "launcher_name"? In string.xml can change it, but when compiling steps to a default value.

Answer1:

<ol><li>There shouldn't be any harm in just adding it manually to the AndroidManifest.xml so that is probably your best option. </li> </ol>

For both 1 and 2, just to confirm, you are editing the config.xml that is at the base of your project? There is another one that gets created in platform/android/res/xml that you should not be editing because it will always be replaced.

Recommend

  • hide the console window when use batch file to launch a java program?
  • AlarmManager to fire notification at every 24 hours
  • ERROR ITMS-9000: Invalid Code Signing
  • image map in WPF
  • phonegap version 4.3 splashscreen doesn't show
  • PhoneGap, iOS 6.1 shows weird alert on launch and hangs at load screen
  • How to associate a file type with a (my) Java application on OSX?
  • Android app showing in Google Play for Phone but not for Google Play for Tablets
  • You have not accepted the licenses arguments after run sdkmanager.bat --licenses - Android SDK
  • set header and footer in BlackBerry in VerticalFieldManager
  • android.support libraries not compatible together after updation
  • Gradle Build Failure java.io.IOException: The output jar is empty
  • Pyinstaller adding splash screen or visual feedback during file extraction
  • Android not responding if Debugging. If not in Debug app works normally
  • Error ':app:packageAllDebugClassesForMultiDex'. > java.util.zip.ZipException: duplicate
  • Neither user 10036 nor current process has android.permission.DEVICE_POWER.
  • Kotlin fails to compile a library
  • Execution failed for task : 'app.transformClassesWithDesugarForDebug'. after importing pro
  • How to use Android's AppCompat theming application-wide?
  • Dependency commons-logging:commons-logging:1.2 is ignored for debug as it may be conflicting with th
  • ios phonegap disallow overscroll not working properly
  • PHP SwiftMailer or PEAR Mail
  • Compressing “n”-time object member call
  • iPhone Phonegap based app load External website made of componentone
  • How to set a URL scheme/link for a react-native app
  • TimePickerDialog widget in landscape mode (PreferenceScreen)
  • PhoneGap : How to upload APK files on Google Play Store
  • Android NFC read Tags issue. Activity starts each time on data received
  • Phonegap GA plugin not working
  • Web.config system.webserver errors
  • Sonar maven jacoco code coverage for Multimodule project
  • Force show.bind execution
  • Disable Enter in editText android
  • How do I change content of ComboFieldEditor?
  • Shallow update not allowed (git > 1.9)
  • jquery mobile loadPage not working
  • How to include full .NET prerequisite for Wix Burn installer
  • Qt: Run a script BEFORE make
  • Linking SubReports Without LinkChild/LinkMaster
  • Easiest way to encapsulate a HTML5 webpage into an android app?