Configuring Web Applications
This topic describes Web application configuration, especially for privileges and features specific to Samsung TVs and other devices. Many privileges and features available for mobile and wearable Web applications are also available for TV Web applications.
Related Info
All Tizen Web application projects must have a "config.xml" file in the project root directory. The configuration file is composed of XML elements, including the <widget>
element as its root. The configuration information is used when you install or run the Tizen Web application.
The "config.xml" file contains the following information:
-
Application ID:
The Samsung TV SDK automatically creates an application ID, which uniquely identifies the application within the package.<tizen:application id="{Package}.{Project Name}" ... />
-
Application version:
The application version format is "x.y.z".<widget … version="{0-255}.{0-255}.{0-65535}" ... />
-
Application icon:
File path for the launcher icon.<icon src="Icon Path" />
-
HTML content:
File path for the start-up file of the Web application. By default, it is the "index.html" file in the root directory.<content src="HTML Path" />
-
Privileges:
Tizen and Samsung Product APIs that handle platform and user-sensitive data require privileges that must be declared before the APIs can be used.<tizen:privilege name="http://tizen.org/privilege/{Privilege Name}" /> <tizen:privilege name="http://developer.samsung.com/privilege/{Privilege Name}" />
-
Network access policy:
According to the W3C Access Requests Policy (WARP), you cannot access network resources by default. For more information, see Defining External Access Policies in the Policy Tab. -
Meta data features:
Some features, such as prelaunching, are implemented by adding values to the<tizen:metadata>
element. -
Mouse support:
Interaction with the application using a mouse, is enabled by default. If you want to disable it for your application, add the following key and value to the<tizen:setting>
element in the "config.xml" file:<tizen:setting pointing-device-support="disable" />
In the Tizen Studio, you can edit the configuration file in 2 ways:
-
Web Configuration Editor:
You can easily set the project configuration (manifest) using a form editor, even if you have no experience in developing a Tizen Web application project. -
Configuration source editor:
If you are fluent in the configuration file XML structure, you can modify the XML structure directly through the configuration source editor.
For more information, see Configuring Applications and Setting Project Properties.
Privileges
To use security-sensitive APIs, you must declare the required privileges by adding key-value pairs to the <tizen:privilege>
element and sign your application with a certificate for the appropriate privilege level. You can add privileges to the "config.xml" file using the "Privileges" tab of the Configuration Editor in the Tizen Studio.
Tizen Web Device API Privileges
The following table lists the privileged Tizen APIs specific to Smart TVs and other devices commonly in brief.
For more information on Tizen API privileges, see Security and API Privileges.
Privilege | Level | Related API |
---|---|---|
http://tizen.org/privilege/tv.audio
|
Public | TVAudioControl API |
http://tizen.org/privilege/tv.display
|
TVDisplayControl API | |
http://tizen.org/privilege/tv.inputdevice
|
TVInputDevice API | |
http://tizen.org/privilege/tv.window
|
TVWindow API |
Table 1. Tizen Web Device API privileges
http://tizen.org/privilege/tv.audio
public level privilege has been deprecated since Tizen 5.0.Samsung Product API Privileges
The following table lists the privileged Samsung Product APIs in brief.
For more information on Samsung Product API privileges supported on Samsung TV, see API Reference.
Privilege | Level | Related API |
---|---|---|
http://developer.samsung.com/privilege/allshare
|
Public | ASFService API |
http://developer.samsung.com/privilege/drmplay
|
AVPlay API | |
http://developer.samsung.com/privilege/network.public
|
Network API | |
http://developer.samsung.com/privilege/productinfo
|
ProductInfo API | |
http://developer.samsung.com/privilege/tvinfo
|
TvInfo API | |
http://developer.samsung.com/privilege/widgetdata
|
WidgetData API |
Table 2. Samsung Product API privileges
W3C/HTML5 API Privileges
The following table lists the privileges, you must declare when using W3C/HTML5 APIs in Web applications running on Smart TVs and other devices.
For more information, see W3C/HTML5 API Reference.
Privilege | Level | Related API |
---|---|---|
http://tizen.org/privilege/mediacapture
|
Public | getUserMedia API (Partial) |
http://tizen.org/privilege/unlimitedstorage
|
File API: Directories and System File API: Writer (Partial) Indexed Database API (Partial) Web SQL Database |
Table 3. W3C/HTML API privileges
Meta Data
Some features are implemented by adding key-value pairs to the <tizen:metadata>
element. You can add meta data in the "Tizen" tab of the Configuration Editor in the Tizen Studio.
The following table lists the meta data keys available for Smart TVs and other devices.
Key | Value (default in bold) |
Since | Description |
---|---|---|---|
http://samsung.com/tv/metadata/prelaunch.support
|
“true” “false” |
Tizen 2.3 (2015) | Enable or disable prelaunching. The default value is “false” for 2015 models. |
http://samsung.com/tv/metadata/use.network
|
Enable or disable checking the network connection when the application is launched. | ||
http://samsung.com/tv/metadata/auto.update
|
Enable or disable automatically updating the application during regularly-scheduled updates. | ||
http://samsung.com/tv/metadata/force.update
|
“true” “false” |
(2015 ~ 2016) |
Enable or disable automatically updating the application outside regularly-scheduled updates. |
http://samsung.com/tv/metadata/use.preview
|
JSON file path | Tizen 2.4 (2016) | Content for Smart Hub Preview. |
http://samsung.com/tv/metadata/gamepad
|
Gamepad model name | Require a specific gamepad model to be connected. | |
http://samsung.com/tv/metadata/use.voiceguide
|
“true” “false” |
Enable or disable voice guide for the application, if the user has enabled it in the TV settings. |
Table 4. Meta data