Configuring Applications
PUBLISHED
The Tizen Web application configuration file is composed of XML elements, including the <widget>
element as its root and other elements. These elements represent application information, such as configuration elements and Tizen extending configuration elements for mobile and wearable applications.
This configuration information is used when you install or run the Tizen Web application on the Tizen platform. The Tizen Web application project must have the config.xml
file in the project root directory.
The configuration file can be easily edited with the Web application configuration editor (form editor), or you can modify the XML structure directly using the configuration source editor. With the form editor, you can set the project configuration (manifest), even if you have no experience with developing a Tizen Web application project. If you are fluent with the configuration file XML structure, you can create the configuration file directly through the configuration source editor.
config.xml
must conform to both the XML file format and the W3C specification requirements. Editing the file XML structure with the configuration source editor is intended for advanced users only.Editing the config.xml File
There are 2 different ways to edit the config.xml
file:
- Use the Source tab:
- Double-click the
config.xml
file in the Project Explorer view. - Select the Source tab.
Figure: Source tab
- Double-click the
- Use the form tabs:
- Double-click the
config.xml
file in the Project Explorer view. - Select one of the form tabs (Overview, Features, Privileges, Localization, Policy, Preferences, Tizen).
Figure: Form tabs
- Double-click the
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> |
|||
<access> |
|||
<tizen:icon> |
|||
<tizen:display-name> |
|||
<tizen:capability> |
|||
<tizen:account> (in mobile or wearable) |
|||
<tizen:allow-navigation> (in mobile or wearable) |
|||
<tizen:app-control> (in mobile or wearable) |
|||
<tizen:src> |
|||
<tizen:operation> |
|||
<tizen:uri> |
|||
<tizen:mime> |
|||
<tizen:privilege> |
|||
<tizen:app-widget> (in wearable only) |
|||
<tizen:widget-label> |
|||
<tizen:widget-content> |
|||
<tizen:widget-size> |
|||
<tizen:widget-metadata> |
|||
<tizen:appdefined-privilege> (in mobile or wearable) |
|||
<tizen:application> (in mobile or wearable) |
|||
<author> |
|||
<span> |
|||
<tizen:background-category> (in mobile or wearable) |
|||
<tizen:category> (in wearable only) |
|||
<content> |
|||
<tizen:content> (in mobile or wearable) |
|||
<tizen:content-security-policy> (in mobile or wearable) |
|||
<tizen:content-security-policy-report-only> (in mobile or wearable) |
|||
<description> |
|||
<span> |
|||
<feature> (in mobile or wearable) |
|||
<param> |
|||
<icon> |
|||
<tizen:ime> (in wearable only) |
|||
<tizen:uuid> |
|||
<tizen:languages> |
|||
<tizen:language> |
|||
<tizen:launch_screen> (in mobile or wearable) |
|||
<tizen:ls_default> |
|||
<tizen:ls_landscape> |
|||
<tizen:ls_portrait> |
|||
<license> |
|||
<span> |
|||
<tizen:metadata> (in mobile or wearable) |
|||
<name> |
|||
<span> |
|||
<preference> |
|||
<tizen:privilege> (in mobile or wearable) |
|||
<tizen:provides-appdefined-privilege> (in mobile or wearable) |
|||
<tizen:profile> (in mobile or wearable) |
|||
<tizen:service> (in wearable only) |
|||
<tizen:name> |
|||
<tizen:icon> |
|||
<tizen:content> |
|||
<tizen:description> |
|||
<tizen:metadata> |
|||
<tizen:category> |
|||
<tizen:setting> (in mobile or wearable) |
|||
<tizen:trust-anchor> (in mobile or wearable) |
Configuration Elements
The following tables summarize the W3C configuration elements used in the config.xml
file of a Web application. For more information on the W3C element details, see Widget 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:
Attributes:
|
<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:
|
<author> element |
---|
Represents the person who created the Web application.
Expected children:
Attributes:
|
<content> element |
---|
Represents the boot-strapping mechanism used to point to the main file of the Web application.
Attributes:
|
<description> element |
---|
Represents text describing the purpose of the Web application.
Expected children:
Attributes:
|
<icon> element |
---|
Represents the Web application icon.
Attributes:
|
<license> element |
---|
Represents the license under which the Web application is distributed.
Expected children:
Attributes:
|
<name> element |
---|
Represents the Web application name used, for example, in the application menu.
Expected children:
Attributes:
|
<param> element |
---|
Used to declare parameters to be used with a feature in mobile and wearable applications.
Attributes:
|
<preference> element |
---|
Used to declare preferences as key-value pairs for the Web application for use at runtime.
Attributes:
|
<span> element |
---|
Represents the generic container used mainly for internationalization.
Expected children:
Attributes:
|
Extending Configuration Elements in Mobile Applications
The following sections show additional configuration elements used in the config.xml
file of a 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.
xmlns:tizen="http://tizen.org/ns/widgets"
namespace declaration is in effect.
The maximum length of the attribute and the 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:
Expected children:
Attributes:
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 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:
Example: <tizen:allow-navigation>tizen.org *.tizen.org<tizen:allow-navigation/> |
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 Information and Controls.
Occurrences:
Expected children:
Example: <tizen:app-control> <tizen:src name="view.html" reload="disable"/> <tizen:operation name="http://tizen.org/appcontrol/operation/view"/> <tizen:uri name="http"/> <tizen:mime name="image/jpeg"/> <tizen:privilege name="http://tizen.org/privilege/alarm"/> </tizen:app-control> |
Tizen App-defined Privilege
<tizen:appdefined-privilege/> element |
---|
Used to get the required access privileges provided by a provider package.
Occurrences:
Attributes:
Example: <tizen:appdefined-privilege name="http://{provider_pkgid}/appdefined/exampleprivilege1"/> <tizen:appdefined-privilege license="example_license" name="http://{provider_pkgid}/appdefined/exampleprivilege2"/> |
Tizen Application ID
<tizen:application/> element |
---|
Used to uniquely identify a Tizen application.
Occurrences:
Attributes:
Example: <tizen:application id="1234abcDEF.projectname" package="1234abcDEF" required_version="2.4" launch_mode="caller"/> |
Tizen Background Category
<tizen:background-category/> element |
---|
Used to represent the category of an application that is allowed to run in the background.
Note In addition to declaring the
<background-category> element, you must set the <tizen:setting background-support> attribute to enable to run Web applications in the background.Occurrences:
Attributes:
Example: <tizen:background-category value="media"/> |
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 Occurrences:
Attributes:
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:
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 monitoring purposes, for a packaged or hosted application.
Occurrences:
Example: <tizen:content-security-policy-report-only> script-src 'self'; report-uri="http://example.com/report.cgi" </tizen:content-security-policy-report-only> |
Tizen Feature
<feature/> element |
---|
Used to define hardware and software components for a Tizen application. This attribute is only used in 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, an extended version is used in Tizen.Occurrences:
Attributes:
Example: <feature name="http://tizen.org/feature/network.bluetooth"/> |
Tizen Launch Screen
<tizen:launch_screen/> element |
---|
Used to indicate the splash screen.
Occurrences:
Expected children:
Attributes:
Example: <tizen:launch_screen ready_when="custom"> <tizen:ls_default background_image="bg.png" background_color="#ff0000" image="icon.png" image_border="0px stretch"/> <tizen:ls_landscape background_image="bg.png" background_color="#00ff00" image="icon.png" image_border="0px stretch"/> <tizen:ls_portrait background_image="bg.png" background_color="#0000ff" image="icon.png" image_border="0px stretch"/> </tizen:launch_screen> |
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:
Attributes:
Example: <tizen:metadata key="key1"/> <tizen:metadata key="key2" value="value/> |
Tizen Privilege
<tizen:privilege/> element |
---|
Used to get the required API access privileges for a Web application.
Occurrences:
Attributes:
Example: <tizen:privilege name="http://tizen.org/privilege/application.launch"/> |
Tizen Provided App-defined Privilege
<tizen:provides-appdefined-privilege/> element |
---|
Used to specify the app-defined access privileges provided by a provider package.
Occurrences:
Attributes:
Example: <tizen:provides-appdefined-privilege name="http://{provider_pkgid}/appdefined/exampleprivilege1"/> <tizen:provides-appdefined-privilege license="example_license" name="http://{provider_pkgid}/appdefined/exampleprivilege2"/> |
Tizen Profile
<tizen:profile/> element |
---|
Used to define the application profile.
Occurrences:
Attributes:
Example: <tizen:profile name="mobile"/> |
Tizen Settings
<tizen:setting/> element |
---|
Used to define additional application settings.
Occurrences:
Attributes:
Example: <!--Viewport orientation is locked to "landscape"--> <tizen:setting screen-orientation="landscape"/> <!--Context menu is not displayed--> <tizen:setting context-menu="disable"/> <!--Web application execution is not suspended--> <!--when the application is sent to the background--> <tizen:setting background-support="enable"/> <!--Web applications resources are stored encrypted by the WRT--> <tizen:setting encryption="enable"/> <!--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 Trust-anchor
<tizen:trust-anchor/> element |
---|
Used to assign your own SSL root certificates for the application's HTTPS communication.
Occurrences:
Attributes:
Example: <tizen:trust-anchor use-system-certs="false"/> |
Extending Configuration Elements in Wearable Applications
The following sections show additional configuration elements used in the config.xml
file of a 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.
xmlns:tizen="http://tizen.org/ns/widgets"
namespace declaration is in effect.
The maximum length of the attribute and the element (except tizen:metadata
, W3C preference element) can be limited to 2048 bytes. In that case, leftover bytes are ignored.
Tizen Account
<tizen:account/> element |
---|
Used to register account provider information.
Occurrences:
Expected children:
Attributes:
Example: <tizen:account multiple-account-support="false"> <tizen:display-name xml:lang="en">AccountProviderExample</tizen:display-name> <tizen:capability>http://tizen.org/account/capability/contact</tizen:capability> </tizen:account> |
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:
Example: <tizen:allow-navigation>tizen.org *.tizen.org<tizen:allow-navigation/> |
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 Information and Controls.
Occurrences:
Expected children:
Example: <tizen:app-control> <tizen:src name="view.html" reload="disable"/> <tizen:operation name="http://tizen.org/appcontrol/operation/view"/> <tizen:uri name="http"/> <tizen:mime name="image/jpeg"/> <tizen:privilege name="http://tizen.org/privilege/alarm"/> </tizen:app-control> |
Tizen Web Widget
<tizen:app-widget/> element |
---|
Used to define the basic information for a Web widget.
Occurrences:
Expected children: Attributes:
Example: <tizen:app-widget id="EHtuCWfzcr.Widget.Widget" primary="true" max-instance="0"> <tizen:widget-label>Hello Web Widget!</tizen:widget-label> <tizen:widget-content src="index.html"> <tizen:widget-size preview="preview.png">2x2</tizen:widget-size> </tizen:widget-content> <tizen:widget-metadata key="index" value="2"/> </tizen:app-widget> |
<tizen:widget-label/> element |
---|
Used to define the name of the Web widget.
Occurrences:
Attributes:
|
<tizen:widget-content/> element |
---|
Used to define the starting page of the Web widget.
Occurrences:
Expected children: Attributes:
|
<tizen:widget-size/> element |
---|
Used to define the size of the Web widget.
Occurrences:
Attributes:
|
<tizen:widget-metadata/> element |
---|
Used to define a (key, value) pair that can be read by a Web widget through the WidgetService API. Its main use is to allow you to define a constant to be read by a Web widget.
Occurrences:
Attributes:
|
Tizen App-defined Privilege
<tizen:appdefined-privilege/> element |
---|
Used to get the required access privileges provided by a provider package.
Occurrences:
Attributes:
Example: <tizen:appdefined-privilege name="http://{provider_pkgid}/appdefined/exampleprivilege1"/> <tizen:appdefined-privilege license="example_license" name="http://{provider_pkgid}/appdefined/exampleprivilege2"/> |
Tizen Application ID
<tizen:application/> element |
---|
Used to uniquely identify a Tizen wearable application.
Occurrences:
Attributes:
Example: <tizen:application id="1234abcDEF.projectname" package="1234abcDEF" required_version="2.4" ambient_support="enable"/> |
Tizen Background Category
<tizen:background-category/> element |
---|
Used to represent the category of an application that is allowed to run in the background.
Note In addition to declaring the
<background-category> element, you must set the <tizen:setting background-support> attribute to enable to run Web applications in the background.Occurrences:
Attributes:
Example: <tizen:background-category value="media"/> |
Tizen Category
<tizen:category/> element |
---|
Used to define the categories to which the service application belongs.
Occurrences:
Attributes:
Example: <tizen:category name="http://tizen.org/category/wearable_clock"/> |
Tizen Content
<tizen:content/> element |
---|
Used to define a start page hosted on an external server.
Occurrences:
Attributes:
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:
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 monitoring purposes, for a packaged or hosted application.
Occurrences:
Example: <tizen:content-security-policy-report-only> script-src 'self'; report-uri="http://example.com/report.cgi" </tizen:content-security-policy-report-only> |
Tizen Feature
<feature/> element |
---|
Used to define the 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, an extended version is used in Tizen.Occurrences:
Attributes:
Example: <feature name="http://tizen.org/feature/network.bluetooth"/> |
Tizen IME
<tizen:ime/> element |
---|
Used to define the properties of an IME (Input Method Editor) type application, which is used when you want to create your own keyboard module for the Tizen platform.
Note
<tizen:category name="http://tizen.org/category/ime"/> must be defined to activate <tizen:ime> .Occurrences:
Expected children:
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:
Example: <tizen:languages> <tizen:language>en-us</tizen:language> <tizen:language>de-de</tizen:language> </tizen:languages> |
Tizen Launch Screen
<tizen:launch_screen/> element |
---|
Used to indicate the splash screen.
Occurrences:
Expected children:
Attributes:
Example: <tizen:launch_screen ready_when="custom"> <tizen:ls_default background_image="bg.png" background_color="#ff0000" image="icon.png" image_border="0px stretch"/> <tizen:ls_landscape background_image="bg.png" background_color="#00ff00" image="icon.png" image_border="0px stretch"/> <tizen:ls_portrait background_image="bg.png" background_color="#0000ff" image="icon.png" image_border="0px stretch"/> </tizen:launch_screen> |
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:
Attributes:
Example: <tizen:metadata key="key1"/> <tizen:metadata key="key2" value="value/> |
Tizen Privilege
<tizen:privilege/> element |
---|
Used to get the required API access privileges for the Web application.
Occurrences:
Attributes:
Example: <tizen:privilege name="http://tizen.org/privilege/application.launch"/> |
Tizen Provided App-defined Privilege
<tizen:provides-appdefined-privilege/> element |
---|
Used to specify the app-defined access privileges provided by a provider package.
Occurrences:
Attributes:
Example: <tizen:provides-appdefined-privilege name="http://{provider_pkgid}/appdefined/exampleprivilege1"/> <tizen:provides-appdefined-privilege license="example_license" name="http://{provider_pkgid}/appdefined/exampleprivilege2"/> |
Tizen Profile
<tizen:profile/> element |
---|
Used to define the application profile.
Occurrences:
Attributes:
Example: <tizen:profile name="wearable"/> |
Tizen Service
<tizen:service/> element |
---|
Used to define a Web service application.
Occurrences:
Expected children:
Attributes:
Example: <tizen:service id="webService.application" auto-restart="true" on-boot="false"> <tizen:content src="service/service.js"/> <tizen:name>WebService</tizen:name> <tizen:icon src="service-icon.png"/> <tizen:description>Web Service Application</tizen:description> <tizen:metadata key="key1" value="value1"/> <tizen:category name="http://tizen.org/category/service"/> <tizen:service> |
<tizen:content/> element |
---|
Used to define the start page of the Web service application.
Occurrences:
Attributes:
|
<tizen:name/> element |
---|
Used to define the name of the Web service application.
Occurrences:
Attributes:
|
<tizen:icon/> element |
---|
Used to define the icon for the Web service application.
Occurrences:
Attributes:
|
<tizen:description/> element |
---|
Used to define the description for the Web service application.
Occurrences:
|
<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:
Attributes:
|
<tizen:category/> element |
---|
Used to define the categories that the service application belongs to.
Occurrences:
Attributes:
|
Tizen Settings
<tizen:setting/> element |
---|
Used to define additional application settings.
Occurrences:
Attributes:
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 Trust-anchor
<tizen:trust-anchor/> element |
---|
Used to assign your own SSL root certificates for the application's HTTPS communication.
Occurrences:
Attributes:
Example: <tizen:trust-anchor use-system-certs="false"/> |