Configuring Application Settings

This section provides an overview of some application settings that can be made for a Cordova Hybrid app.

You can configure your application as required by configuring the application and domain access settings by editing the config.xml file. Apache Cordova uses the file config.xml to configure the application that will be built.

To configure your application settings

  1. If you are using the Cordova CLI with Visual Studio Code, you can open the config.xml file in the editor, and add the tags that corresponds to the items shown in Application tab Properties. Refer to the Cordova documentation at https://cordova.apache.org/docs/en/latest/config_ref/ for details on how to set these and other properties in the config.xml file. For your quick reference, the corresponding tags are listed in the following table.

    Table 1. Application tab Properties

    CategoryDescription
    Display NameType the name of your application as it appeasr on the device's home screen and within any App store.
    Cordova CLI: <name></name>
    DescriptionType the description of the application that can appear in the App store listing.
    Cordova CLI: <description></description>
    AuthorType the name of the author of the application that can appear in the App store listing.
    Cordova CLI: <author></author>
    Start PageSet the start page of your application.  By default, Index.html is the start page.
    Cordova CLI: <content src=”your start page”>
    Package NameType the Bundle ID of your application. The convention is to use a reversed internet domain name. For example, if your organization uses a DNS name of mycompany.com, you might choose a package name for your application of com.mycompany.mydept.myapp. A nonprofit organization might use a package name of org.myorg.mygroup.myapp.
    Cordova CLI: <widget id=”your package name”>
    VersionType the version number of your application.
    Cordova CLI: <widget version=”your package
     version”>

    Orientation

    Select Landscape, Portrait, or Landscape and Portrait (Default) from the list. If you select Orientation as Default, then both the Landscape and Portrait orientations are enabled.

    Cordova CLI: <preference name="Orientation" 
    value="landscape/Portrait" />

    Fullscreen

    Select the check box to view the application in full screen on your mobile device without any status bar. The check box is cleared by default.

    <preference name="Fullscreen" value="true/false" />

  2. On the Domain Access tab, in the URI field , specify a URL that can be accessed by your application.

    Specify * to access any site. You can also specify wildcard characters in subdomain names (for example, https://*.unisys.com or http://*.*.unisys.com).

  3. Click Add to add an additional URL or click Remove to remove a URL from the list.

  4. For the Cordova CLI, use the <allow-navigation> tag to specify the URLs that your application can access.

    For example:

    <allow-navigation href="https://myCompany.com/">

    This is particularly necessary when debugging an iOS application on the simulator or a device. In some cases, it may be appropriate to use a wild-card such as:

    <allow-navigation href=”*”>

    This allows your Cordova application to load any Website. However, it is not recommended to use a wild-card in production.