How to create a valid config.xml file for my Phonegap project?

I am trying to enable the WebIntent plugin for my Android Phonegap application. The documentation for installing it says that you need to add a line to the res/xml/config.xml file. However, I do not have a config.xml file.

I searched a bit and it seems that people are saying that it’s easy to create config.xml , so I did it using some of the recommendations from the examples I came across. However, the Android Developer Tools interface shows red Xs and red squiggly error lines for all of this, indicating that it is full of errors. Here's what it looks like:

invalid config.xml

What does the config.xml file look like?

Or, alternatively, if there is a better tutorial or method to enable the WebIntent plugin, let me know.

+2
android xml cordova
Aug 24 '13 at 4:09
source share
2 answers

Your config.xml file should look like this in Phonegap 2.7 or higher. Older versions do not use function tags. This is the configuration out of the box and everything in it.

 <?xml version="1.0" encoding="UTF-8"?> <widget xmlns = "http://www.w3.org/ns/widgets" id = "io.cordova.helloCordova" version = "2.0.0"> <name>APP NAME</name> <description> DESCRIPTION </description> <author href="YOUR URL" email="YOUR EMAIL"> YOUR NAME </author> <access origin="*"/> <!-- <content src="http://mysite.com/myapp.html" /> for external pages --> <content src="index.html" /> <preference name="loglevel" value="DEBUG" /> <!-- <preference name="splashscreen" value="resourceName" /> <preference name="backgroundColor" value="0xFFF" /> <preference name="loadUrlTimeoutValue" value="20000" /> <preference name="InAppBrowserStorageEnabled" value="true" /> <preference name="disallowOverscroll" value="true" /> --> <feature name="App"> <param name="android-package" value="org.apache.cordova.App"/> </feature> <feature name="Geolocation"> <param name="android-package" value="org.apache.cordova.GeoBroker"/> </feature> <feature name="Device"> <param name="android-package" value="org.apache.cordova.Device"/> </feature> <feature name="Accelerometer"> <param name="android-package" value="org.apache.cordova.AccelListener"/> </feature> <feature name="Compass"> <param name="android-package" value="org.apache.cordova.CompassListener"/> </feature> <feature name="Media"> <param name="android-package" value="org.apache.cordova.AudioHandler"/> </feature> <feature name="Camera"> <param name="android-package" value="org.apache.cordova.CameraLauncher"/> </feature> <feature name="Contacts"> <param name="android-package" value="org.apache.cordova.ContactManager"/> </feature> <feature name="File"> <param name="android-package" value="org.apache.cordova.FileUtils"/> </feature> <feature name="NetworkStatus"> <param name="android-package" value="org.apache.cordova.NetworkManager"/> </feature> <feature name="Notification"> <param name="android-package" value="org.apache.cordova.Notification"/> </feature> <feature name="Storage"> <param name="android-package" value="org.apache.cordova.Storage"/> </feature> <feature name="FileTransfer"> <param name="android-package" value="org.apache.cordova.FileTransfer"/> </feature> <feature name="Capture"> <param name="android-package" value="org.apache.cordova.Capture"/> </feature> <feature name="Battery"> <param name="android-package" value="org.apache.cordova.BatteryListener"/> </feature> <feature name="SplashScreen"> <param name="android-package" value="org.apache.cordova.SplashScreen"/> </feature> <feature name="Echo"> <param name="android-package" value="org.apache.cordova.Echo"/> </feature> <feature name="Globalization"> <param name="android-package" value="org.apache.cordova.Globalization"/> </feature> <feature name="InAppBrowser"> <param name="android-package" value="org.apache.cordova.InAppBrowser"/> </feature> <!-- Deprecated plugins element. Remove in 3.0 --> <plugins> <plugin name="WebIntent" value="com.borismus.webintent.WebIntent" /> </plugins> </widget> 
+3
Aug 24 '13 at 8:51
source share
β€” -

My decision at initial project creation:

Instead of creating a project using the PhoneGap Desktop application, I created a project using PhoneGap cli by typing:

phonegap create "projectName"

This successfully created the project using config.xml. Now you can open the created file using the PhoneGap Desktop application.

Link: http://phonegap.com/blog/2014/11/13/phonegap-cli-3-6 -3 /

0
Jul 12 '16 at 21:29
source share



All Articles