What is cordova.xml for Phonegap?

While trying to debug the Phonegap error message ("Calling OpenGL ES api without the current context", which seems to be causing no problems), I came across a newer version of the cordova.xml file that comes with PhoneGap 1.6 and has the following line:

<preference name="classicRender" value="true" /> 

Adding this line to my copy of cordova.xml did nothing. But then I also noticed comments and other lines in this file about the origin of access, and I noticed that my application has a source of origin set to 127.0.0.1, but all my code is on a remote server, and that does not seem to matter .

I was looking for documentation but not found.

So I have to ask: what is the cordova.xml file, what directives can be entered into it, and what should they do?

+6
source share
1 answer

The cordova.xml file is a configuration file that specifies settings for white URLs, log level, and rendering. The file was previously named phonegap.xml and was renamed when Adobe / Nitobi donated the PhoneGap code base to the Apache Software Foundation (ASF) for incubation.

The file contains three settings.

First up is:

 <access origin> 

which defines an approved list of URLs that can be downloaded. These URLs are added to the white list cache in the DroidGap class. Only whitelisted URLs can be downloaded in the Cordova web browser or in a new instance of the browser.

Secondly:

 <log level> 

which determines the log level for debugging on Android. It can be set to ERROR, WARN, INFO, DEBUG or VERBOSE (default = ERROR).

Thirdly:

 <preference name="classicRender" /> 

which sets the field

 private boolean classicRender; 

in the DroidGap class. The only reference to what it actually does, which I can find, is in this Cordoba commit :

  if(android.os.Build.VERSION.SDK_INT < 14 && this.classicRender) { //This hack fixes legacy PhoneGap apps //We should be using real pixels, not pretend pixels ... 

Perhaps it is more useful to know that it seems to have been removed , as it does not work properly.

The cordova.xml file is parsed in the DroidGap class in the loadConfiguration () method:

 private void loadConfiguration() { int id = getResources().getIdentifier("cordova", "xml", getPackageName()); ... XmlResourceParser xml = getResources().getXml(id); etc... 

See line 1252 in the DroidGap class for the full loadConfiguration () method. All three attributes are parsed, but the link above looks that the classicRender parameter is not working and can be ignored.

+15
source

Source: https://habr.com/ru/post/914931/


All Articles