Friday, July 17, 2015

Cordova Application configuration File - an overview

The global configuration file has the name config.xml. This is a file arranged according to the W3C widget specification. 

The main element is widget. The widget element has id parameter which can be reverse DNS name. The version number here tells the display version name. Application can also have android-versioncode, iOS-CFBundleVersion attributes to specify the platform specific secondary version codes. 

The description element of the xml specifies the meta data about the app which appears in the app store list. The optional content element tells the starting page of the application. 

access element define the set of external domains app is allowed to communicate with. 

The preference tag sets various options as pairs of key value attributes. Many preferences are platform specific and the key case is case sensitive. 

The other few Preferences to note are:

FullScreen, 
DisallowOverScroll
BackgroundColor
HideKeyboardFromAccessoryBar
Orientation

Feature Element : IF CLI is used to build applications, the plugin command to be used for enabling device APIs. This does not modify the top level config.xml. Due to this reason, the fearture element does not apply to the work flow. IF an application work directly in an SDK and using platform specific config.xml, developer need to use feature tag to enable device level APIs and external plugins. 

When CLI is used to build applications, it sometimes becomes necessary to specify preferences or other elements specific to a particular platform. 


References:

No comments:

Post a Comment