While trying to debug a Phonegap error message (“Call to OpenGL ES api with no current context” which doesn’t appear to be causing any problems), I came across a newer version of the cordova.xml file which ships with PhoneGap 1.6 and has the following line in it:
<preference name="classicRender" value="true" />
Adding this line to my copy of cordova.xml didn’t do anything. But then I also noticed the comments and other lines in that file regarding access origins, and I noticed that my app has the access origin set to 127.0.0.1 but all my code is on a remote server, and this doesn’t seem to matter.
I searched for documentation but didn’t find any.
So I have to ask: what is the cordova.xml file for, what directives can be put in it, and what are they supposed to do?
The cordova.xml file is a configuration file that specifies settings for whitelisted urls, log level, and rendering. The file was previously called phonegap.xml and was renamed when Adobe/Nitobi donated the PhoneGap codebase to the Apache Software Foundation (ASF) for incubation.
The file includes three settings.
First is:
which specifies an approved list of URLs that can be loaded. These urls are added to the whitelist cache in the DroidGap class. Only URLs on the whitelist can be loaded in the Cordova webview or a new browser instance.
Second is:
which specifies log level for debugging on Android . It can be set to ERROR, WARN, INFO, DEBUG or VERBOSE (default=ERROR).
Third is:
which sets the field
in the DroidGap class. The only reference to what it actually does that I can find is in this commit to Cordova:
Perhaps it’s more useful to know that it’s apparently being removed since it doesn’t work properly.
The cordova.xml is parsed in the DroidGap class, in the loadConfiguration() method:
See line 1252 in the DroidGap class for full loadConfiguration() method. All three attributes are parsed but as per above link it appears the classicRender setting doesn’t work and can be ignored.