Mobile Web Wearable Web

Configuration Editor

The Tizen Web application configuration file is composed of XML elements, including the <widget> element as its root and other elements representing the application information, such as configuration elements and Tizen extending configuration elements for mobile and wearable applications. Note that although the <feature> element is a W3C element, a modified Tizen extended version of it is used.

The configuration file can be edited with the Web application configuration editor, or you can modify the XML structure directly using the configuration text editor. To open the Web application configuration editor, double-click the config.xml file in the Project Explorer view of the IDE. To use the configuration text editor, right-click the config.xml file in the Project Explorer view and select Open with > Text Editor.

Note
The config.xml must conform to both the XML file format and the W3C specification requirements. Editing the file XML structure with the configuration text editor is intended for advanced users only.

Configuration Element Hierarchy

The Tizen Web application configuration file consists of XML elements organized in a hierarchy. The following tree structure shows the relationship between the elements of the config.xml file.

<widget>
  <name>
    <span>
  <description>
    <span>
  <author>
    <span>
  <content>
  <feature> (in mobile or wearable)
    <param>
  <icon>
  <license>
    <span>
  <preference>
  <access>
  <tizen:account> (in mobile only)
    <tizen:icon>
    <tizen:display-name>
    <tizen:capability>
  <tizen:app-control> (in mobile or wearable)
    <tizen:src>
    <tizen:operation>
    <tizen:uri>
    <tizen:mime>
  <tizen:application> (in mobile or wearable)
  <tizen:content> (in mobile or wearable)
  <tizen:privilege> (in mobile or wearable)
  <tizen:setting> (in mobile or wearable)
  <tizen:content-security-policy> (in mobile or wearable)
  <tizen:content-security-policy-report-only> (in mobile or wearable)
  <tizen:allow-navigation> (in mobile or wearable)
  <tizen:metadata> (in mobile or wearable)
  <tizen:profile> (in mobile or wearable)
  <tizen:ime> (in wearable only)
    <tizen:uuid>
    <tizen:languages>
      <tizen:language>
  <tizen:category> (in wearable only)
  <tizen:service> (in wearable only)
    <tizen:name>
    <tizen:icon>
    <tizen:content>
    <tizen:description>
    <tizen:metadata>
    <tizen:category>

Configuration Elements

The following tables define a summary of the W3C configuration elements used in the config.xml file of the Web application. For more information on the W3C element details, see Packaging and XML Configuration (the details of the Tizen extending configuration elements are described in Extending Configuration Elements in Mobile Applications and Extending Configuration Elements in Wearable Applications). For a quick view of the element hierarchy, see Configuration Element Hierarchy.

<widget> element

Represents the root element of a configuration document.

Expected children:

<name>, <description>, <author>, <license>, <icon>, <content>, <feature>, <preference>, <access>, <tizen:account>, <tizen:app-control>, <tizen:application>, <tizen:content>, <tizen:privilege>, <tizen:setting>, and <tizen:profile>

Attributes:

  • xml:lang
  • dir
  • id
  • version

    Specific version of the Tizen package. The expected value is [0-255].[0-255].[0-65535].

  • height
  • width
  • viewmodes
  • defaultlocale
<name> element

Represents the Web application name used for example, in the application menu.

Expected children:

<span> and <text node>

Attributes:

  • xml:lang
  • dir
  • short
<description> element

Represents text describing the purpose of the Web application.

Expected children:

<span> and <text node>

Attributes:

  • xml:lang
  • dir
<author> element

Represents the person that created the Web application.

Expected children:

<span> and <text node>

Attributes:

  • xml:lang
  • dir
  • href
  • email
<content> element

Represents the boot-strapping mechanism used to point to the main file of the Web application.

Attributes:

  • xml:lang
  • dir
  • encoding
  • src
  • type
<icon> element

Represents the Web application icon.

Attributes:

  • xml:lang
  • dir
  • src
  • width
  • height
<license> element

Represents the license under which the Web application is distributed.

Expected children:

<span> and <text node>

Attributes:

  • xml:lang
  • dir
  • href
<preference> element

Used to declare preferences as key-value pairs for the Web application for use at runtime.

Attributes:

  • name

    The maximum length may be limited to 80 bytes. In that case, leftover bytes are ignored.

  • value

    The maximum length may be limited to 8192 bytes. In that case, leftover bytes are ignored.

  • readonly
<access> element

Used to control network access from within a Web application and to request access to certain network resources from the user agent.

Attributes:

  • origin
  • subdomains
<span> element

Represents the generic container used mainly for internationalization.

Expected children:

<span> and <text node>

Attributes:

  • xml:lang
  • dir
<param> element

Used to declare parameters to be used with a feature in mobile and wearable applications.

Attributes:

  • xml:lang
  • dir
  • name
  • value

Extending Configuration Elements in Mobile Applications

The following sections show additional configuration elements used in the config.xml file of the Web application, but not included in the Widget Packaging and XML Configuration guidelines. For a quick view of the entire element hierarchy, see Configuration Element Hierarchy.

Note
The extension elements are denoted as though the following namespace declaration was in effect: xmlns:tizen="http://tizen.org/ns/widgets".

The maximum length of attribute and element (except <tizen:metadata>, W3C preference element) can be limited to 2048 bytes. In this case, leftover bytes are ignored.

Tizen Account

<tizen:account /> element

Used to register account provider information.

Occurrences:

  • 0 or more

Expected children:

  • icon

    Mandatory. Since the icons are used in the device under Settings > Accounts, place them in a shared directory.

    Attributes:

    • Account - File path of the account provider icon. The icon size is 72 x 72 pixels.
    • AccountSmall - File path of the account provider small icon. The icon size is 45 x 45 pixels.
  • display-name

    Mandatory; display name of the account provider

  • capability

    Optional; capability of the account provider. Capabilities are defined in the http://<VENDOR_INFORMATION>/accounts/capability/<NAME> IRI format.

Attributes:

  • multiple-account-support

    Mandatory; indicates whether multiple accounts are supported (available values: true, false)

Example:

<tizen:account multiple-account-support="false">
   <tizen:icon section="Account">account_provider_icon.png</tizen:icon>
   <tizen:icon section="AccountSmall">account_provider_small_icon.png</tizen:icon>
   <tizen:display-name xml:lang="en">AccountProviderExample</tizen:display-name>
   <tizen:capability>http://tizen.org/account/capability/contact</tizen:capability>
</tizen:account>

Tizen Application Control

<tizen:app-control /> element

Used to indicate that the Web application can handle a specific operation with the specified MIME type and URI. For more information, see Application Controls.

Occurrences:

  • 0 or more

Expected children:

  • src

    Mandatory; page handling the requests

  • operation

    Mandatory; string that defines the action to be performed

  • uri and mime

    Optional; additional parameters used for resolving application control requests

Example:

<tizen:app-control>
   <tizen:src name="view.html"/>
   <tizen:operation name="http://tizen.org/appcontrol/operation/view"/>
   <tizen:uri name="http"/>
   <tizen:mime name="image/jpeg"/>
</tizen:app-control>

Tizen Application ID

<tizen:application /> element

Used to uniquely identify a Tizen application.

Occurrences:

  • 1

Attributes:

  • id

    Mandatory; Tizen application ID, which is a combination of the Tizen package ID and project name. The application ID is unique in the device.

    The project name is a set of characters (0~9, a~z, A~Z) randomly generated by the SDK. The minimum value is 1 byte and maximum value is 52 bytes.

  • package

    Mandatory; Tizen package ID generated by the SDK, comprises of 10 characters (0~9, a~z, A~Z). The package ID is unique in the Tizen Store.

  • required_version

    Mandatory; Tizen API version required for running the Web application

Example:

<tizen:application id="1234abcDEF.projectname"
                   package="1234abcDEF"
                   required_version="2.1" />

Tizen-hosted Web Application

<tizen:content /> element

Used to point to a document which is hosted on an external server and acts as the Web application start page. The Tizen WRT allows the start page to be hosted on an external server.

If the start page is contained in the widget package, it is defined with the <content> W3C element. If both <content> and <tizen:content /> elements are defined, the <tizen:content /> element is used.

Occurrences:

  • 0 or more

    If more than 1 <tizen:content /> elements are specified, the first instance of the element is used.

Attributes:

  • src

    Mandatory; URI of the external start page

Example:

<tizen:content src="https://www.tizen.org/" />

Tizen Privilege

<tizen:privilege /> element

Used to get the required API access privileges for the Web application.

Occurrences:

  • 0 or more (if duplicates, the first occurrence is considered and all others ignored)

Attributes:

  • name

    Mandatory; URI of the Device API privilege

Example:

<tizen:privilege name="http://tizen.org/privilege/application.launch" />

Tizen Settings

<tizen:setting /> element

Used to define additional application settings.

Occurrences:

  • 0 or more

Attributes:

  • background-support

    Optional; application execution continues when it is moved to the background (available values enable, disable (default))

  • context-menu

    Optional; context menu is displayed when the user clicks, for example, an image, text, or link (available values: enable (default), disable)

  • encryption

    Optional; Web application resources (HTML, JavaScript, and CSS files) are stored encrypted (available values: enable, disable (default))

  • screen-orientation

    Optional; viewport orientation lock (available values: portrait (default), landscape), auto-rotation

    If the system auto rotation setting is on, the Web application viewport orientation is changed accordingly by default.

  • install-location

    Optional; application installation location (available values: auto (default), internal-only, prefer-external)

  • hwkey-event

    Optional; a hardware key event is sent to the Web application when the user presses the hardware key (available values: enable (default), disable)

    If this option is enabled, the tizenhwkey custom event is sent to the Web application. The tizenhwkey event object has a keyName attribute (available values: menu and back).

Example:

<!--Web application execution is not suspended-->
<!--when the application is sent to the background-->
<tizen:setting background-support="enable" />

<!--Context menu is not displayed-->
<tizen:setting context-menu="disable" />

<!--Web applications resources are stored encrypted by the WRT-->
<tizen:setting encryption="enable" />

<!--Viewport orientation is locked to "landscape"-->
<tizen:setting screen-orientation="landscape" />

<!--Installation location is set to "internal-only"-->
<tizen:setting install-location="internal-only" />

<!--Hardware key event is sent to the Web application when the hardware key is pressed-->
<tizen:setting hwkey-event="enable" />

Tizen Feature

<feature /> element

Used to define hardware and software components for a Tizen application. This attribute is only used in the Tizen Store for filtering purposes. It is ignored by the Web Runtime installation procedure.

Note
Even though the <feature /> element is defined in the Widget Packaging and XML Configuration guidelines, in Tizen, an extended version is used.

Occurrences:

  • 0 or more

Attributes:

Example:

<feature name="http://tizen.org/feature/network.bluetooth" />

Tizen Content Security Policy

<tizen:content-security-policy /> element

Used to define an additional content security policy for a packaged or hosted application.

Occurrences:

  • 0 or more

    If more than 1, the first occurrence is applied.

Example:

<tizen:content-security-policy>script-src 'self'</tizen:content-security-policy>

Tizen Content Security Policy Report Only

<tizen:content-security-policy-report-only /> element

Used to define an additional content security policy for a packaged or hosted application for monitoring purposes.

Occurrences:

  • 0 or more

    If more than 1, the first occurrence is applied.

Example:

<tizen:content-security-policy-report-only>
   script-src 'self'; report-uri="http://example.com/report.cgi"
</tizen:content-security-policy-report-only>

Tizen Navigation Policy

<tizen:allow-navigation /> element

Used to define a list of URL domains that are allowed to be navigated in using the Web application.

Occurrences:

  • 0 or more

    If more than 1, the first occurrence is applied.

Example:

<tizen:allow-navigation>tizen.org *.tizen.org<tizen:allow-navigation/>

Tizen Metadata

<tizen:metadata /> element

Used to define metadata information shared with other Web applications. The defined metadata can be accessed (read-only) through the Tizen Application API.

Occurrences:

  • 0 or more

Attributes:

  • key

    Mandatory; unique key string.

    The maximum length can be limited to 80 bytes. In this case, leftover bytes are ignored.

  • value

    Optional; string.

    The maximum length can be limited to 8192 bytes. In this case, leftover bytes are ignored.

Example:

<tizen:metadata key="key1"/>
<tizen:metadata key="key2" value="value/>

Tizen Profile

<tizen:profile /> element

Used to define the application profile.

Occurrences:

  • 1

Attributes:

  • name

    Mandatory; string.

Example:

<tizen:profile name="mobile" />

Extending Configuration Elements in Wearable Applications

The following sections show additional configuration elements used in the config.xml file of the Web application, but not included in the Widget Packaging and XML Configuration guidelines. For a quick view of the entire element hierarchy, see Configuration Element Hierarchy.

Note
The extension elements are denoted as though the following namespace declaration was in effect: xmlns:tizen="http://tizen.org/ns/widgets".

The maximum length of the attribute and element (except tizen:metadata, W3C preference element) may be limited to 2048 bytes. In that case, leftover bytes are ignored.

Tizen Application

<tizen:application /> element

Used to uniquely identify a Tizen wearable application.

Occurrences:

  • 1

Attributes:

  • id

    Mandatory; Tizen application ID, which is a combination of the Tizen wearable package ID and project name. The application ID is unique in the device.

    The project name is a set of characters (0~9, a~z, A~Z) randomly generated by the SDK. The minimum value is 1 byte and maximum value is 52 bytes.

  • package

    Mandatory; Tizen wearable package ID generated by the SDK, comprises of 10 characters (0~9, a~z, A~Z). The package ID is unique in the Samsung Apps.

  • required_version

    Mandatory; Tizen API version required for running the Web application

  • ambient_support

    Optional; Sets whether the Web application supports the ambient mode (available values: enable, disable (default))

    If this option is enabled, the application can be shown in the ambient mode. Since 2.3.1.

    Note
    The ambient_support option is only used for watch applications, and ignored in all non-watch applications.
    The ambient_support attribute is supported from Tizen 2.3.1 onwards. If the required_version in the config.xml file of an application is set to a version before Tizen 2.3.1, and the ambient_support attribute is used, the application fails to install.

Example:

<tizen:application id="1234abcDEF.projectname"  
                   package="1234abcDEF"
                   required_version="2.3.1"
                   ambient_support="enable" />

Tizen Privilege

<tizen:privilege /> element

Used to get the required API access privileges for the Web application.

Occurrences:

  • 0 or more

Attributes:

  • name

    Mandatory; URI of the Device API privilege

Example:

<tizen:privilege name="http://tizen.org/privilege/application.launch" />

Tizen Application Control

<tizen:app-control /> element

Used to indicate that the Web application can handle a specific operation with the specified MIME type and URI. For more information, see Application Controls.

Occurrences:

  • 0 or more

Expected children:

  • src

    Mandatory; page handling the requests

  • operation

    Mandatory; string that defines the action to be performed

  • uri and mime

    Optional; additional parameters used for resolving application control requests

Example:

<tizen:app-control>
   <tizen:src name="view.html"/>
   <tizen:operation name="http://tizen.org/appcontrol/operation/view"/>
   <tizen:uri name="http"/>
   <tizen:mime name="image/jpeg"/>
</tizen:app-control>

Tizen Settings

<tizen:setting /> element

Used to define additional application settings.

Occurrences:

  • 0 or more

Attributes:

  • background-support

    Optional; Sets whether Web Application is suspended when it goes to the background (available values: enable , disable (default))

    If this option is enabled, Web Application is not suspended when it goes to the background.

  • context-menu

    Optional; Sets whether the context menu is shown (available values: enable (default), disable)

    If this option is enabled, the context menu is visible to the user.

  • encryption

    Optional; Sets whether Web Application resources are encrypted (available values: enable , disable (default))

    If this option is enabled, the application resources(HTML, JS and CSS files) are encrypted.

  • screen-orientation

    Optional; Sets whether it locks orientation of Web Application (available values: portrait (default), landscape, auto-rotation)

    If this option is portrait or landscape, the orientation is locked to portrait or landscape respectively.

    If the option is auto-rotation, it follows device orientation setting.

  • install-location

    Optional; Sets where Web Application is installed (available values: auto (default), internal-only, prefer-external)

    o auto: the system defined install location.

    o internal-only: the device internal storage.

    o prefer-external: the external storage (if exists).

  • hwkey-event

    Optional; a hardware key event is sent to the Web application when the user presses the hardware key (available values: enable (default), disable)

    If this option is enabled, the tizenhwkey custom event is sent to the Web application. The tizenhwkey event object has a keyName attribute (available value: back).

Example:

<tizen:setting background-support="enable" />
<tizen:setting context-menu="disable" />
<tizen:setting encryption="enable" />
<tizen:setting screen-orientation="landscape" />
<tizen:setting install-location="internal-only" />
<tizen:setting hwkey-event="enable" />

Tizen Content

<tizen:content /> element

Used to define the start page to be hosted on an external server.

Occurrences:

  • 0 or more

    If more than 1, the first occurrence is considered and all others ignored.

Attributes:

  • src

    Mandatory; URI of an external start page

Example:

<tizen:content src="https://www.tizen.org"/>

Tizen Content Security Policy

<tizen:content-security-policy /> element

Used to define an additional content security policy for a packaged or hosted application.

Occurrences:

  • 0 or more

    If more than 1, the first occurrence is applied.

Example:

<tizen:content-security-policy>script-src 'self'</tizen:content-security-policy>

Tizen Content Security Policy Report Only

<tizen:content-security-policy-report-only /> element

Used to define an additional content security policy for a packaged or hosted application for monitoring purposes.

Occurrences:

  • 0 or more

    If more than 1, the first occurrence is applied.

Example:

<tizen:content-security-policy-report-only>
   script-src 'self'; report-uri="http://example.com/report.cgi"
</tizen:content-security-policy-report-only>

Tizen Navigation Policy

<tizen:allow-navigation /> element

Used to define a list of URL domains that are allowed to be navigated in using the Web application.

Occurrences:

  • 0 or more

    If more than 1, the first occurrence is applied.

Example:

<tizen:allow-navigation>tizen.org *.tizen.org<tizen:allow-navigation/>

Tizen Metadata

<tizen:metadata /> element

Used to define metadata information shared with other Web applications. The defined metadata can be accessed (read-only) through the Tizen Application API.

Occurrences:

  • 0 or more

Attributes:

  • key

    Mandatory; unique key string.

    The maximum length may be limited to 80 bytes. In that case, leftover bytes are ignored.

  • value

    Optional; string.

    The maximum length may be limited to 8192 bytes. In that case, leftover bytes are ignored.

Example:

<tizen:metadata key="key1"/>
<tizen:metadata key="key2" value="value/>

Tizen IME

<tizen:ime /> element

Used to defines the properties of IME (Input Method Editor) type application, which would be used when the developer wants to create his or her own keyboard module for Tizen platform.

Note
<tizen:category name="http://tizen.org/category/ime"/> should be defined to activate <tizen:ime>

Occurrences:

  • 0 or 1

Expected children:

  • uuid

    Mandatory; universally unique, an unique identifier that distinguishes an IME from each other, displayed in the form of standard UUID (8-4-4-4-12 for a total of 36 characters)

  • languages

    Mandatory; list of input languages that the current IME supports

    Note
    <tizen:language/> elements will be provided as the child elements of this element.

Example:

<tizen:ime>
    <tizen:uuid>6135122a-a428-40d2-8feb-a75f462c202c</tizen:uuid>
    <tizen:languages>
        <tizen:language>en-us</tizen:language>
        <tizen:language>de-de</tizen:language>
    </tizen:languages>
</tizen:ime>

<tizen:category name="http://tizen.org/category/ime"/>

<tizen:language /> element

Used to define the supported input language of the current IME type application.

Occurrences:

  • 1 or more

Example:

<tizen:languages>
  <tizen:language>en-us</tizen:language>
  <tizen:language>de-de</tizen:language>
</tizen:languages>

Tizen Category

<tizen:category /> element

Used to define the categories to which the service application belongs.

Occurrences:

  • 0 or more

Attributes:

  • name

    Mandatory; string

Example:

<tizen:category name="http://tizen.org/category/wearable_clock" />

Tizen Service

<tizen:service /> element

Used to define Web Service Application.

Occurrences:

  • 0 or more

Expected Children:

Attributes:

  • id

    Mandatory; Tizen service ID, which is a combination of the Tizen wearable package ID and service name.

    The service ID is a set of characters (0~9, a~z, A~Z) and unique in the device. The minimum value is 1 byte and maximum value is 52 bytes.

  • auto-restart

    Optional; Sets whether service application is re-launched automatically when it is terminated. (available values: true , false (default))

  • on-boot

    Optional; Sets whether service application is launched automatically on device booting time. (available values: true , false (default))

Example:

<tizen:service id="webService.application" auto-restart="true" on-boot="false">
   <tizen:name>WebService</tizen:name>
   <tizen:icon src="service-icon.png"/>
   <tizen:content src="service/service.js"/>
   <tizen:description>Web Service Application</tizen:description>
   <tizen:metadata key="key1" value="value1"/>
   <tizen:category name="http://tizen.org/category/service"/>
<tizen:service>

<tizen:name /> element

Used to define the name of Web Service Application.

Occurrences:

  • 1 or more

Attributes:

<tizen:icon /> element

Used to define the icon of Web Service Application.

Occurrences:

  • 0 or 1

Attributes:

  • src

    Mandatory; file path of the Web Service Application icon. The path is relative to the source Web application directory.

<tizen:content /> element

Used to define the start page of the Web Service Application.

Occurrences:

  • 1

Attributes:

  • src

    Mandatory; start JavaScript file path of the Web Service Application. The path is relative to the source Web application directory.

<tizen:description /> element

Used to define the description of the Web Service Application.

Occurrences:

  • 0 or 1

<tizen:metadata /> element

Used to define metadata information shared with other Web Applications. The defined metadata can be accessed (read-only) through the Tizen Application API.

Occurrences:

  • 0 or more

Attributes:

  • key

    Mandatory; unique key string

  • value

    Optional; string

<tizen:category /> element

Used to define the categories that the service application belongs to.

Occurrences:

  • 0 or more

Attributes:

  • name

    Mandatory; string.

Tizen Profile

<tizen:profile /> element

Used to define the application profile.

Occurrences:

  • 1

Attributes:

  • name

    Mandatory; string.

Example:

<tizen:profile name="wearable" />

Tizen Feature

<feature /> element

Used to define hardware and software components for a Tizen wearable Web application. This attribute is only used in the Samsung Apps for filtering purposes. It is ignored by the Web Runtime installation procedure.

Note
Even though the <feature /> element is defined in the Widget Packaging and XML Configuration guidelines, in Tizen, an extended version is used.

Occurrences:

  • 0 or more

Attributes:

Example:

<feature name="http://tizen.org/feature/network.bluetooth" />

Go to top