<h2 id="export_appcontrol" name="export_appcontrol">Application Control Export</h2>
<p>You can allow other applications to launch your application and use your application features through application controls by exporting your application control functionalities. To allow other applications to launch your application implicitly without the application ID, declare your application control information in the <code>tizen-manifest.xml</code> file:</p>
- <pre class="prettyprint">
+<pre class="prettyprint">
<app-control>
<mime name="application/xhtml+xml"/>
<operation name="http://tizen.org/appcontrol/operation/view"/>
evas_object_smart_callback_add(bt, "clicked", button_click_cb, NULL);
evas_object_show(ad->win);
-}</pre></li>
+}
+</pre></li>
<li>When the button is clicked, use an application control to launch the sub application.
<p>Define the launch mode for the application to be called using the <code>app_control_set_launch_mode()</code> function. The second parameter defines the launch mode with the <code>app_control_launch_mode_e</code> enumerator (in <a href="../../../../org.tizen.native.mobile.apireference/group__CAPI__APP__CONTROL__MODULE.html#gadf26b03f2f6b18acba4a946e7eb7b31c">mobile</a> applications).</p>
<li>Set the count attribute with the <code>badge_set_count()</code> function.
<p>The parameters are the name of the application whose badge count is updated, and the new badge count.</p>
<pre class="prettyprint">
-ret = badge_set_count(TEST_PKG, count+1);
+ret = badge_set_count(TEST_PKG, count + 1);
if (ret != BADGE_ERROR_NONE)
/* Error handling */
</pre>
<p>When <code>app_id</code> is no longer needed, release it using the <code>free()</code> function.</p></li>
<li><p>Check whether the application with the given application context is terminated:</p>
- <pre class="prettyprint">
+<pre class="prettyprint">
bool terminated = false;
ret = app_context_is_terminated(app_context, &terminated);
ret = app_context_clone(&app_context_cloned, app_context);
</pre></li>
<li><p>Check whether 2 contexts are equal:</p>
- <pre class="prettyprint">
+<pre class="prettyprint">
bool equal = false;
ret = app_context_is_equal(app_context, app_context_cloned, &equal);
return -1;
}
- app_control_set_operation(service, APP_CONTROL_OPERATION_SETTING_WIFI);
+ app_control_set_operation(service, APP_CONTROL_OPERATION_SETTING_WIFI);
ret = app_control_send_launch_request(service, NULL, NULL);
app_control_destroy(service);
map_data->str_arr[0] = g_strdup(value);
g_hash_table_insert(map_repository_test, g_strdup(key), map_data);
} else {
- char **new_arr = (char**)calloc(map_data->arr_size+2, sizeof(char*));
+ char **new_arr = (char**)calloc(map_data->arr_size + 2, sizeof(char*));
for (int i = 0; i < map_data->arr_size; i++)
new_arr[i] = g_strdup(map_data->str_arr[i]);
free(map_data->str_arr);
<div id="container"><div id="contents"><div class="content">
<h1>Curl</h1>
-<p>You can implement URL-related transfer activities in Tizen without a Web browser using the open source <a href="http://curl.haxx.se/libcurl/" target="_blank">libcurl</a> library, version 7.40. libcurl is a client-side URL transfer library that supports, among other protocols, HTTP, HTTPS, FTP, and file URIs.</p>
+<p>You can implement URL-related transfer activities in Tizen without a Web browser using the open source <a href="http://curl.haxx.se/libcurl/" target="_blank">libcurl</a> library, version 7.40. libcurl is a client-side URL transfer library that supports, among other protocols, HTTP, HTTPS, FTP, and file URIs.</p>
<p>The main features of the Curl API include:</p>
<ul>
<ul>
<li>Information message with the <code>DLOG_INFO</code> priority and the <code>MyTag</code> tag:
- <pre class="prettyprint">
+<pre class="prettyprint">
/* Print the info message with the tag to the console */
dlog_print(DLOG_INFO, "MyTag", "Initialization successful.");
</pre></li>
<li>Debug message with the <code>DLOG_DEBUG</code> priority and the <code>MyTag</code> tag:
- <pre class="prettyprint">
+<pre class="prettyprint">
/* Print the debug message with the tag to the console */
-dlog_print(DLOG_DEBUG, "MyTag", "string:","%s", "Test");
+dlog_print(DLOG_DEBUG, "MyTag", "string:", "%s", "Test");
</pre></li>
<li>Error message with the <code>DLOG_ERROR</code> priority and the <code>MyTag</code> tag:
- <pre class="prettyprint">
+<pre class="prettyprint">
if (something_wrong) {
/* Print the error message with the tag to the console */
dlog_print(DLOG_ERROR, "MyTag", "An unexpected error occurred");
}
</pre></li>
<li>Warning message with the <code>DLOG_WARN</code> priority and the <code>MyTag</code> tag:
- <pre class="prettyprint">
+<pre class="prettyprint">
/* Print the warning message with the tag to the console */
dlog_print(DLOG_WARN, "MyTag", "warning!");
</pre></li>
glClear(GL_COLOR_BUFFER_BIT);
/* Usual OpenGL® ES draw commands come here */
/* draw_scene(); */
-}</pre>
+}
+</pre>
<p>At every tick, set the given context as a current context for the given surface using the <code>evas_gl_make_current()</code> function.</p>
</li>
<p>The following code shows an example vertex shader. The shader language is C-like but provides specialized types. For example, <code>mat4</code> is a 4x4 matrix and <code>vec3</code> is a 3D vector. The following vertex shader example has 5 input values: <code>viewProjMat</code> and <code>worldMat</code> are 'uniforms' described by the keyword uniform, whereas <code>position</code>, <code>normal</code>, and <code>texCoord</code> are 'attributes' described by the keyword attribute.</p>
<pre class="prettyprint">
-uniform mat4 viewProjMat; /* 4x4 matrix for view+projection transforms */
+uniform mat4 viewProjMat; /* 4x4 matrix for view + projection transforms */
uniform mat4 worldMat; /* 4x4 matrix for world transform */
attribute vec3 position;
</li>
<li>Select a physical device.
<p>After creating a Vulkan instance, look for and select a graphics card in the system that supports the features you need. You can select any number of graphics cards and use them simultaneously, but the following example only selects the first graphics card. The selected graphics card is stored in a <code>VkPhysicalDevice</code> handle.</p>
-<p>Retrieve the list the graphics cards, store them in an array of the <code>VkPhysicalDevice</code> handles, and select the first graphics card as the physical device:</p>
+<p>Retrieve the list the graphics cards, store them in an array of the <code>VkPhysicalDevice</code> handles, and select the first graphics card as the physical device:</p>
<pre class="prettyprint">
VkPhysicalDevice *physical_devices = malloc(sizeof(VkPhysicalDevice) * gpu_count);
err = vkEnumeratePhysicalDevices(demo->inst, &gpu_count, physical_devices);
<td>values[0]: temperature</td>
<td><code>float</code></td>
<td>Min. value = -30 <p>Max. value = 100</p></td>
- <td>℃</td>
+ <td>°C</td>
</tr>
</tbody>
</table>
<li>Query a route from a starting point to a destination specified as a geographical location.</li>
<li>Query a route passing through a number of geographical locations.</li>
</ul>
- <p>After performing the <a href="#use_search_route">route service request</a>, you receive the route search response. You can <a href="#route">parse the route calculation response</a> to use its details. The response consists of structured route information, comprising, for example, of a route ID, geographical coordinates of the start and destination point, route bounding box, transportation mode, and total distance and duration.</p>
+ <p>After performing the <a href="#use_search_route">route service request</a>, you receive the route search response. You can <a href="#route">parse the route calculation response</a> to use its details. The response consists of structured route information, comprising, for example, of a route ID, geographical coordinates of the start and destination point, route bounding box, transportation mode, and total distance and duration.</p>
dlog_print(DLOG_DEBUG, LOG_TAG, "Media count in this album: %d\n", count);
return true;
-}</pre>
+}
+</pre>
</li>
</ul>
dlog_print(DLOG_DEBUG, LOG_TAG, "Size: %llu\n", size);
return true;
-}</pre>
+}
+</pre>
<div class="note">
</pre>
<p>A handle to the record is passed as a parameter. The return value determines whether the iterative calls of the callback continue (<code>true</code>) or are stopped (<code>false</code>).</p>
</li>
-<li>Once you have the bookmark handle (<code>media_bookmark_h</code>), you can read the bookmark information:
+<li>Once you have the bookmark handle (<code>media_bookmark_h</code>), you can read the bookmark information:
<ul>
<li>Use the <code>media_bookmark_get_thumbnail_path()</code> function to get the thumbnail path of the bookmark:
free(folder_id);
return true;
-}</pre>
+}
+</pre>
<div class="note">
</p>
<pre class="prettyprint">
/* Find all playlists */
-media_playlist_foreach_playlist_from_db(NULL, playlist_list_cb, NULL);
+media_playlist_foreach_playlist_from_db(NULL, playlist_list_cb, NULL);
/* Find filtered playlists */
-media_playlist_foreach_playlist_from_db(filter, playlist_list_cb, NULL);
+media_playlist_foreach_playlist_from_db(filter, playlist_list_cb, NULL);
</pre>
<p>The <code>media_playlist_foreach_playlist_from_db()</code> function requires a callback, which is called for every found playlist. The function is synchronous, and it blocks until the callback has been called for all playlists or the callback returns <code>false</code>. For information on how to implement the callback, see <a href="#read_playlist">Reading Playlist Information</a>.</p>
<li>
<p>Start recording using the <code>recorder_start()</code> function. If the target file path and name have been set to an existing file, the existing file is replaced with a new file.</p>
- <pre class="prettyprint">
+<pre class="prettyprint">
/* Start the recorder */
error_code = recorder_start(rec_data.recorder);
</pre>
}
uint8_t *index = (uint8_t*)buffer;
- while (index < (((uint8_t*)buffer)+buffer_size)) {
+ while (index < (((uint8_t*)buffer) + buffer_size)) {
if (AUDIO_SAMPLE_TYPE_S16_LE == sample_type) {
/* Use the int16_t type, because it is 2 bytes long */
int16_t *value = (int16_t*)index;
_send_reg_id_if_necessary(const char *reg_id)
{
unsigned char md[SHA_DIGEST_LENGTH];
- char hash_string[2*SHA_DIGEST_LENGTH+1];
+ char hash_string[2 * SHA_DIGEST_LENGTH + 1];
char *buf_ptr = hash_string;
char *stored_hash_value = NULL;
int ret;
/* Convert byte array to hex string */
for (i = 0; i < SHA_DIGEST_LENGTH; i++)
buf_ptr += sprintf(buf_ptr, "%02X", md[i]);
- hash_string[2*SHA_DIGEST_LENGTH] = '\0';
+ hash_string[2 * SHA_DIGEST_LENGTH] = '\0';
/* Get the saved hash string */
ret = preference_get_string(PUSH_HASH_KEY, &stored_hash_value);
</pre></li>
<li><p>After deleting the notification, free the internal structure data of the notification handle by calling the <code>notification_free()</code> function:</p>
-<pre class="prettyprint">ret = notification_free(notification);
+<pre class="prettyprint">
+ret = notification_free(notification);
if (ret != NOTIFICATION_ERROR_NONE)
/* Error handling */
</pre></li></ol>
i18n_ucalendar_destroy(ucal);
return ms2sec(date);
-}</pre>
+}
+</pre>
<pre class="prettyprint">
/* Insert contact to the database */
contacts_db_insert_record(contact, &contact_id);
-contacts_record_destroy(contact, true);</pre>
+contacts_record_destroy(contact, true);
+</pre>
<div class="note">
</li>
<li>To use the functions and data types of the Sync Manager API, include the <code><sync_manager.h></code> header file in the UI application:
- <pre class="prettyprint">
+<pre class="prettyprint">
#include <sync_manager.h>
</pre></li>
<li>To use the functions and data types of the Sync Adapter API, include the <code><sync_adapter.h></code> header file in the service application:
/* Error handling */
/* The total plain text length must be passed (only needed if AAD is passed) */
- if (yaca_seal_update(ctx, NULL, LOREM4096_SIZE , NULL, &len) != YACA_ERROR_NONE)
+ if (yaca_seal_update(ctx, NULL, LOREM4096_SIZE, NULL, &len) != YACA_ERROR_NONE)
/* Error handling */
/* Provide any AAD data */
/* Error handling */
/* The total encrypted text length must be passed (only needed if AAD is passed) */
- if (yaca_open_update(ctx, NULL, enc_len , NULL, &len) != YACA_ERROR_NONE)
+ if (yaca_open_update(ctx, NULL, enc_len, NULL, &len) != YACA_ERROR_NONE)
/* Error handling */
/* Provide any AAD data */
ret = vc_elm_unset_command_hint(handler);
if (VC_ELM_ERROR_NONE != ret)
/* Error handling */
-}</pre>
+}
+</pre>
</li>
</ol>
<pre class="prettyprint">
typedef Signal<bool ( Actor, const TouchData& )> TouchDataSignalType;
-TouchDataSignalType& TouchSignal();</pre>
+TouchDataSignalType& TouchSignal();
+</pre>
<p>This means that a slot of the following type can be connected to the return value of the <code>Actor::TouchSignal()</code> function:</p>
<pre class="prettyprint">
{
Toolkit::PushButton button = Toolkit::PushButton::New();
button.SetSize( 100, 100 );
- button.SetPosition( 100*i+50, 50 );
+ button.SetPosition( 100 * i + 50, 50 );
button.ClickedSignal().Connect( this, OnButtonClicked );
// Register a custom property having button index
elm_object_style_set(btn, "custom2");
return layout;
-}</pre>
+}
+</pre>
<script type="text/javascript" src="../../../scripts/jquery.zclip.min.js"></script>
label = elm_label_add(box);
elm_object_text_set(label, "overlay swallow part");
evas_object_show(label);
-elm_box_pack_end(box,label);
+elm_box_pack_end(box, label);
elm_naviframe_item_push(nf, "Background", NULL, NULL, bg, NULL);
</pre>
label = elm_label_add(box);
elm_object_text_set(label, "overlay swallow part");
evas_object_show(label);
-elm_box_pack_end(box,label);
+elm_box_pack_end(box, label);
elm_naviframe_item_push(nf, "Background", NULL, NULL, bg, "empty");
</pre>
_opened_cb(void *data, Evas_Object *obj, void *event_info)
{
dlog_print(DLOG_INFO, LOG_TAG, "Open the More Option\n");
-}</pre>
+}
+</pre>
<script type="text/javascript" src="../../../scripts/jquery.zclip.min.js"></script>
overriding the default theme.</p>
<p>Applications can add and delete a theme in the list of overlays with the following calls:</p>
- <pre class="prettyprint">
+<pre class="prettyprint">
elm_theme_overlay_add(NULL, "./theme_button.edj");
elm_theme_overlay_del(NULL, "./theme_button.edj");
</pre>
changed_cb(void *data, Evas_Object *obj, void *event_info)
{
dlog_print(DLOG_INFO, LOG_TAG, "Datetime field changed. \n");
-}</pre>
+}
+</pre>
<div class="note">
<strong>Note</strong>
anim_start_cb(void *data, Evas_Object *obj, void *event_info)
{
dlog_print(DLOG_INFO, LOG_TAG, "Animation starts\n");
-}</pre>
+}
+</pre>
</li>
</ol>
<h2 id="interact">User Interactions</h2>
<p>Execute an animation:</p>
<ul><li>To check whether the image supports animation, use the <code>elm_image_animated_available_get()</code> function.</li>
-<li>To define whether the image must animate itself, use the <code>elm_image_animated_set()</code> function. To enable the animation, use the <code>EINA_TRUE</code> flag.</li>
+<li>To define whether the image must animate itself, use the <code>elm_image_animated_set()</code> function. To enable the animation, use the <code>EINA_TRUE</code> flag.</li>
<li>To control the animation, use the <code>elm_image_animated_play_set()</code> function. To play the animation, use the <code>EINA_TRUE</code> flag, and to stop the animation, use the <code>EINA_FALSE</code> flag.</li>
</ul>
elm_toolbar_item_state_add(it, "icon.png", "State 2", _item_pressed_cb, NULL);
</pre>
<p>You can cycle through the item states to set the state you want:</p>
- <pre class="prettyprint">
+<pre class="prettyprint">
elm_toolbar_item_state_set(it, elm_toolbar_item_state_next(it));
</pre>
<ol>
<li>Set a tooltip text to a button component using the <code>elm_object_tooltip_text_set()</code> function:
- <pre class="prettyprint">
+<pre class="prettyprint">
Evas_Object *button = elm_button_add(parent);
evas_object_show(button);
</tr>
<tr>
<td>
- <pre class="prettyprint">
+<pre class="prettyprint">
Evas_Object *win;
Evas_Object *conf;
Evas_Object *nf;
</tr>
<tr>
<td>
- <pre class="prettyprint">
+<pre class="prettyprint">
static void
create_base_gui(appdata_s *ad)
{
<li>Show or hide an indicator with the <code>elm_win_indicator_mode_set()</code> function.</li>
<li>Add a conformant to the window with the <code>elm_win_resize_object_add()</code> function.
<p>In most cases, you want the content of the window to be resized every time the window is resized due to rotation. To match the content size with the window size, make the content expand to fit the container size with the <code>evas_object_size_hint_weight_set()</code> function and add it to the window with the <code>elm_win_resize_object_add()</code> function.</p>
- <pre class="prettyprint">
+<pre class="prettyprint">
Evas_Object *win;
Evas_Object *obj;
</tr>
<tr>
<td>
- <pre class="prettyprint">
+<pre class="prettyprint">
static void
create_base_gui(appdata_s *ad)
{
<p>To build a layout with a box:</p>
<ol>
<li>Add a box with the <code>elm_box_add()</code> function:
- <pre class="prettyprint">
+<pre class="prettyprint">
Evas_Object *box;
box = elm_box_add(parent);
<td>
<p align="center"><img alt="Box layout" src="../../../images/box1.png" /></p>
- <pre class="prettyprint">
+<pre class="prettyprint">
image = elm_image_add(box);
elm_image_file_set(image, ICON_DIR"/tizen.png", NULL);
evas_object_size_hint_min_set(image, 200, 200);
return;
}
}
-}</pre>
+}
+</pre>
<p align="center"><strong>Figure: Changed object order</strong></p>
<p align="center"><img alt="Changed object order" src="../../../images/changed_order.png" /></p>
font_size: 36;
<span class="highlight">text_class: "label";</span>
}
-}</pre></li>
+}
+</pre></li>
<li>Use the system font when creating a text part with the <code>tizen</code> text class.
<p>When the object is created or if the system setting changes, the part loads the new system font. However, the part font size remains 36 regardless of the new system font size, because the <code>tizen</code> text class does not apply system font size changes.</p>
font_size: 36;
<span class="highlight">text_class: "tizen";</span>
}
-}</pre>
+}
+</pre>
</li>
<li>Use the system font when creating a text part or setting the UI component text font.
<li>
<p>Create a window with the check UI component. Define a callback for when the check component is selected.</p>
- <pre class="prettyprint">
+<pre class="prettyprint">
static void
create_base_gui(appdata_s *ad)
{
<p>When an application has new information requiring user attention, such as missed calls or new messages, it has a number in the upper right hand corner of the application icon. This number is called a badge. For example, when a new message is received, the badge appears on the application icon. The badge remains until the user reads the message.</p>
-<p><p>This feature is supported in mobile and wearable applications only.</p></p>
+<p>This feature is supported in mobile and wearable applications only.</p>
<p align="center"><strong>Figure: Badge</strong></p>
<p align="center"><img alt="Badge" src="../../images/badge.png" /></p>
<h2 id="Prerequisites">Prerequisites</h2>
<p>To use the Convergence API (in <a href="../../../../org.tizen.web.apireference/html/device_api/mobile/tizen/convergence.html">mobile</a> and <a href="../../../../org.tizen.web.apireference/html/device_api/wearable/tizen/convergence.html">wearable</a> applications), the application has to request permission by adding the following privileges to the <code>config.xml</code> file:</p>
- <pre class="prettyprint">
+<pre class="prettyprint">
<tizen:privilege name="http://tizen.org/privilege/bluetooth"/>
<tizen:privilege name="http://tizen.org/privilege/internet"/>
<tizen:privilege name="http://tizen.org/privilege/d2d.datasharing"/>
<ol>
<li>Search for nearby devices with the <code>startDiscovery()</code> method:
- <pre class="prettyprint">
+<pre class="prettyprint">
var timeout = 60 * 60;
try {
<li>When the discovery is finished and no more devices are found, the <code>onfinished</code> event is triggered.</li>
</ul>
- <pre class="prettyprint">
+<pre class="prettyprint">
var discoverySuccessCallback = {
onfound: function(device) {
console.log('Found a device');
<ol>
<li>Create a <code>ChannelInfo</code> object. It identifies the server and is used by the clients to address their demands. The first parameter of the <code>ChannelInfo</code> constructor is the server's application ID, set in its <code>config.xml</code> file. The second parameter is an ID set by you.
- <pre class="prettyprint">
+<pre class="prettyprint">
var requestChannel = new tizen.ChannelInfo('targetApp0.main', 'chA');
</pre>
</li>
<li>Define the success and error callbacks for the server service start:
- <pre class="prettyprint">
+<pre class="prettyprint">
function onerror(err) {
console.log(err.name +': ' + err.message);
}
</pre>
</li>
<li>Instantiate an <code>AppCommunicationServerService</code> object:
- <pre class="prettyprint">
+<pre class="prettyprint">
var service = new tizen.AppCommunicationServerService();
</pre>
</li>
<li>Start the server service. In addition to the <code>ChannelInfo</code> object, you must provide the success and error callbacks defined earlier.
- <pre class="prettyprint">
+<pre class="prettyprint">
service.start(requestChannel, onstarted, onerror);
</pre></li>
</ol>
<p>To wait for incoming messages on the server side:</p>
<ol>
<li><p>The started server service handles incoming messages through the <code>onnotify</code> callback, which is invoked when another service attempts to communicate with the server. The callback receives the sent payload and data about its sender.</p>
- <pre class="prettyprint">
+<pre class="prettyprint">
function onnotify(channel, payload, senderclientid) {
console.log('On service notification');
console.log('channel uri: ' + channel.uri);
</pre></li>
<li><p>To be able to receive messages, register the <code>onnotify</code> callback with the <code>setListener()</code> method:</p>
- <pre class="prettyprint">
+<pre class="prettyprint">
service.setListener(onnotify);
</pre>
<p>After the callback has been registered, all incoming data is handled by the <code>onnotify</code> callback.</p></li>
<ol>
<li><p>Discover available server services on the client side:</p>
- <pre class="prettyprint">
+<pre class="prettyprint">
function onerror(err) {
console.log(err.name +': ' + err.message);
}
}
</pre></li>
<li><p>Create a <code>ChannelInfo</code> instance with the same URI and ID as the channel used on the server side. Then start the available server service and send the payload to it.</p>
- <pre class="prettyprint">
+<pre class="prettyprint">
var serverService;
var channel = new tizen.ChannelInfo('targetApp0.main', 'chA');
<ol>
<li><p>Call the <code>startDiscovery()</code> method to establish connections with remote devices:</p>
- <pre class="prettyprint">
+<pre class="prettyprint">
var discoverySuccessCallback = {
onfound: function(device) {
for (i in device.services) {
}
</pre></li>
<li><p>An application on the remote device is started from the <code>onconnected</code> callback. The <code>remoteAppControlCallback</code> method handles the data sent from the remote device.</p>
- <pre class="prettyprint">
+<pre class="prettyprint">
var requestAppId = 'targetApp0.main';
function remoteAppControlCallback(data) {
<p>The <code>ApplicationControl</code> object is used to request applications to perform particular actions. This use case shows how to ask an image viewer to display a picture. For more information on application controls, see <a href="../../../../org.tizen.guides/html/web/app_management/app_controls_w.htm">Application Controls</a>.</p>
<ol>
<li><p>Use the <code>startDiscovery()</code> method to search for and connect to a <code>RemoteAppControlService</code>:</p>
- <pre class="prettyprint">
+<pre class="prettyprint">
var discoverySuccessCallback = {
onfound: function(device) {
for (i in device.services) {
}
</pre></li>
<li><p>Create the <code>ApplicationControl</code> object:</p>
- <pre class="prettyprint">
+<pre class="prettyprint">
var requestAppControl =
new tizen.ApplicationControl('http://tizen.org/appcontrol/operation/view', null,
'image/jpeg', null,
[new tizen.ApplicationControlData('images', [testImgData])]);
</pre></li>
- <li><p>Use the <code>onconnected()</code> callback to send the application control request to the remote service. The <code>launchAppControl()</code> method takes as parameters the <code>ApplicationControl</code> object, optionally the target application ID, and a callback defining the actions to be taken on the remote service reply.</p><pre class="prettyprint">
+ <li><p>Use the <code>onconnected()</code> callback to send the application control request to the remote service. The <code>launchAppControl()</code> method takes as parameters the <code>ApplicationControl</code> object, optionally the target application ID, and a callback defining the actions to be taken on the remote service reply.</p>
+<pre class="prettyprint">
function remoteAppControlCallback(data) {
for (var i = 0; i < data.length; i++) {
console.log('key: ' + data[i].key + 'value: ' + data[i].value[0]);
});
</pre></li>
- <li>Define the event handlers for different download process notifications using the <code>DownloadCallback</code> listener interface (in <a href="../../../../org.tizen.web.apireference/html/device_api/mobile/tizen/download.html#DownloadCallback">mobile</a>, <a href="../../../../org.tizen.web.apireference/html/device_api/wearable/tizen/download.html#DownloadCallback">wearable</a>, and <a href="../../../../org.tizen.web.apireference/html/device_api/tv/tizen/download.html#DownloadCallback">TV</a> applications):
+ <li>Define the event handlers for different download process notifications using the <code>DownloadCallback</code> listener interface (in <a href="../../../../org.tizen.web.apireference/html/device_api/mobile/tizen/download.html#DownloadCallback">mobile</a>, <a href="../../../../org.tizen.web.apireference/html/device_api/wearable/tizen/download.html#DownloadCallback">wearable</a>, and <a href="../../../../org.tizen.web.apireference/html/device_api/tv/tizen/download.html#DownloadCallback">TV</a> applications):
<pre class="prettyprint">
var listener = {
/* When the download progresses (interval is platform-dependent) */
<p>This feature is supported in mobile and wearable applications only.</p>
-
<p>The main features of the XMLHttpRequest API include:</p>
<ul>
<li>Supporting cross-origin request sharing (CORS)
<div class="note">
<strong>Note</strong>
- Since the device input takes place by touching the screen, sometimes the features of your application and the browser can respond simultaneously to the same touch event. To prevent the unintended effects (for example, the customized gesture and the browser scroll operating simultaneously), use the <code>preventDefault()</code> method to prevent the basic browser events:
+ Since the device input takes place by touching the screen, sometimes the features of your application and the browser can respond simultaneously to the same touch event. To prevent the unintended effects (for example, the customized gesture and the browser scroll operating simultaneously), use the <code>preventDefault()</code> method to prevent the basic browser events:
<pre class="prettyprint">
<script>
touchable.addEventListener('touchmove', function(e) {
<p>You can use the <code>Play()</code> and <code>Pause()</code> methods of the <code>Media</code> object (in <a href="http://www.w3.org/TR/2014/REC-html5-20141028/embedded-content-0.html#media-elements" target="_blank">mobile</a> and <a href="http://www.w3.org/TR/2014/CR-html5-20140429/embedded-content-0.html#media-elements" target="_blank">wearable</a> applications) to <a href="#play">control playing and pausing</a> media files. With media events, additional features can be used.</p>\r
</li>\r
<li>Retrieving duration and play time\r
-<p>You can <a href="#retrieve">retrieve the duration and play time</a> of the media file, if its metadata (such as playing time, duration, and video's width and height) is loaded.</p>\r
+<p>You can <a href="#retrieve">retrieve the duration and play time</a> of the media file, if its metadata (such as playing time, duration, and video's width and height) is loaded.</p>\r
</li>\r
<li>Playing from a random position\r
<p>You can indicate the playback time by <a href="#move">playing the media file from a random position</a>. To do this, you must change the <code>currentTime</code> value of the <code>Media</code> object to trigger the <code>timeupdate</code> event (in <a href="http://www.w3.org/TR/2014/REC-html5-20141028/embedded-content-0.html#event-media-timeupdate" target="_blank">mobile</a> and <a href="http://www.w3.org/TR/2014/CR-html5-20140429/embedded-content-0.html#event-media-timeupdate" target="_blank">wearable</a> applications).</p>\r
</tbody>\r
</table>\r
<h2 id="loops" name="loops">Removing Slow Loop Statements</h2>\r
-<p> The <code>for - in</code> loop is relatively slower than the other loops, such as <code>for</code>, <code>while</code>, and <code>do - while</code>, as it assigns object properties to the variable (<code>idx</code> in the example below), navigating the object every time the loop is iterated. The following example shows how modifying the loop improves performance.</p>\r
+<p> The <code>for - in</code> loop is relatively slower than the other loops, such as <code>for</code>, <code>while</code>, and <code>do - while</code>, as it assigns object properties to the variable (<code>idx</code> in the example below), navigating the object every time the loop is iterated. The following example shows how modifying the loop improves performance.</p>\r
<pre class="prettyprint">\r
/* Code#1 */\r
var array_list = [0,1,2,3,4,5,6,7,8,9],\r
var blob = file.slice(startByte, endByte);
</pre>
-<p>A new <code>Blob</code> object is created. </p>
+<p>A new <code>Blob</code> object is created.</p>
</li>
<li>
<p>Read the data as a binary string using the <code>readAsBinaryString()</code> method:</p>
});
</pre>
-<p>The difference between the <code>transaction()</code> and <code>readTransaction()</code> methods is that the latter cannot be used with SQL statements that change the database (such as <code>INSERT</code>, <code>UPDATE</code>, <code>DELETE</code>, or <code>CREATE</code>).</p>
+<p>The difference between the <code>transaction()</code> and <code>readTransaction()</code> methods is that the latter cannot be used with SQL statements that change the database (such as <code>INSERT</code>, <code>UPDATE</code>, <code>DELETE</code>, or <code>CREATE</code>).</p>
<div class="note">
<strong>Note</strong>
});
</pre>
-<p>The difference between the <code>transaction()</code> and <code>readTransaction()</code> methods is that the latter cannot be used with SQL statements that change the database (such as <code>INSERT</code>, <code>UPDATE</code>, <code>DELETE</code>, or <code>CREATE</code>).</p>
+<p>The difference between the <code>transaction()</code> and <code>readTransaction()</code> methods is that the latter cannot be used with SQL statements that change the database (such as <code>INSERT</code>, <code>UPDATE</code>, <code>DELETE</code>, or <code>CREATE</code>).</p>
<div class="note">
<strong>Note</strong>
</li>
<li><p>Import the <code>vertexAttribPointer()</code> method that indicates the data format to the shader.</p>
-<p>The second argument value is the number of components per vertex. It can be 2, 3, or, in case of RGBA, 4.</p>
+<p>The second argument value is the number of components per vertex. It can be 2, 3, or, in case of RGBA, 4.</p>
<pre class="prettyprint">
gl.vertexAttribPointer(vertexPositionAttribute, 2, gl.FLOAT, false, 0, 0);
<tr>
<td><code>build</code></td>
<td>
- <pre class="prettyprint">
+<pre class="prettyprint">
build: [
{
name: <build alias>,
<tr>
<td><code>method</code></td>
<td>
- <pre class="prettyprint">
+<pre class="prettyprint">
method: [
{
name: <method name>,
<tr>
<td><code>package</code></td>
<td>
- <pre class="prettyprint">
+<pre class="prettyprint">
package: [
{
name: <package name>,
<li><code>devices</code>
<p>The command shows a list of connected devices. If you specify the <code>-u</code> option, only the devices where tracing is already launched through the CLI are listed.</p>
<p>Command syntax:</p>
-<pre class="prettyprint">devices [-u]</pre>
+<pre class="prettyprint">
+devices [-u]
+</pre>
<p>For example:</p>
<pre class="prettyprint">
<p>To start the emulator and run an application:</p>
<ol>
<li>Open the <a href="emulator_manager.htm#access">Emulator Manager</a>.
-<p>If you do not have an applicable emulator instance, <a href="emulator_manager.htm#create">create one</a>.</p></li>
+<p>If you do not have an applicable emulator instance, <a href="emulator_manager.htm#create">create one</a>.</p></li>
<li>Select the emulator instance and click <strong>Launch</strong>.</li>
<li>Test your application in the emulator. You can launch your application in 2 ways:
<ul>
<p>Before running the application, install a USB-connected Webcam or embedded Webcam on your computer. On Linux, the Webcam feature uses libv4l-0. If you do not have it on your computer, this feature does not work properly. You can check the feature status with the following command:</p>
-<pre class="prettyprint">$ dpkg -l | grep libv4l-0</pre>
+<pre class="prettyprint">
+$ dpkg -l | grep libv4l-0
+</pre>
<div class="note">
<strong>Note</strong>
<p>The SDB provides port forwarding as a command. For more <code>user,id=net0</code> information in the SDB commands, see <a href="smart_development_bridge.htm#command">sdb forward</a>.</p></li>
<li>Launch configuration on boot
<p>You can forward the port on booting the emulator by modifying the QEMU redirection option. The QEMU redirection option can be appended in the existing <code>-netdev user,id=net0</code> option in the <code><TIZEN_STUDIO_DATA>/emulator/vms/<image name>/vm_launch.conf</code> file with the following appending command:</p>
-<pre class="prettyprint">-netdev user,id=net0,hostfwd=[tcp|udp]:[<hostaddr>]:<hostport>-[<guestaddr>]:<guestport></pre>
+<pre class="prettyprint">
+-netdev user,id=net0,hostfwd=[tcp|udp]:[<hostaddr>]:<hostport>-[<guestaddr>]:<guestport>
+</pre>
<p>Redirect incoming TCP or UDP connections to the <hostport> host port to the <guestaddr> guest IP address on the <guestport> guest port. If the <guestaddr> is not specified, its value is 10.0.2.15 (default first address given by the built-in DHCP server).</p>
</hover>
</form>
</formList>
-</EmulatorUI></pre>
+</EmulatorUI>
+</pre>
<p>The emulator skin also contains a <code><TIZEN_STUDIO>/platforms/<PLATFORM_VERSION>/<PROFILE>/emulator-resources/skins/<SKIN_NAME>/info.ini</code> property file. The file defines skin-related information, such as skin name and supported resolutions.</p>
<p>The following example shows the contents of the <code>info.ini</code> property file:</p>
-<pre class="prettyprint">skin.name=Phone 480x800
+<pre class="prettyprint">
+skin.name=Phone 480x800
resolution.width=480
resolution.height=800
</pre>
<li>Native Component Designer
<ul>
- <li>The vector-type "part" is not supported. You cannot see the vector image and change the SVG file.</li>
+ <li>The vector-type part is not supported. You cannot see the vector image and change the SVG file.</li>
<li>Playing sound is not supported on Windows® or macOS.</li>
</ul>
</li>
<tr>
<td>Prerequisite packages (<code>msgfmt</code>) for build PO files</td>
<td>At the terminal prompt, enter the following commands:
- <pre class="prettyprint">
+<pre class="prettyprint">
$ brew install gettext
$ brew link gettext –force
$ which msgfmt
<tr>
<td>Prerequisite packages (webkitgtk and cpio) for developing applications</td>
<td>At the terminal prompt, enter the following command:
- <pre class="prettyprint">$ sudo apt-get install libwebkitgtk-1.0-0 cpio rpm2cpio</pre>
+<pre class="prettyprint">
+$ sudo apt-get install libwebkitgtk-1.0-0 cpio rpm2cpio
+</pre>
</td>
</tr>
<tr>
<td>Prerequisite packages (glib, curl, sdl, pixel manipulation) for using the emulator</td>
<td>At the terminal prompt, enter the following command for Tizen Studio:
- <pre class="prettyprint">$ sudo apt-get install acl bridge-utils openvpn libfontconfig1 libglib2.0-0 libjpeg-turbo8 libpixman-1-0 libpng12-0 libsdl1.2debian libsm6 libv4l-0 libx11-xcb1 libxcb-icccm4 libxcb-image0 libxcb-randr0 libxcb-render-util0 libxcb-shape0 libxcb-xfixes0 libxi6</pre>
+<pre class="prettyprint">
+$ sudo apt-get install acl bridge-utils openvpn libfontconfig1 libglib2.0-0 libjpeg-turbo8 libpixman-1-0 libpng12-0 libsdl1.2debian libsm6 libv4l-0 libx11-xcb1 libxcb-icccm4 libxcb-image0 libxcb-randr0 libxcb-render-util0 libxcb-shape0 libxcb-xfixes0 libxi6
+</pre>
</td>
</tr>
</tbody>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document>
<mscreen>
- <configuration device="HD" id="config1" name="common" orientation="portrait" type="common" />
- <configuration orientation="landscape" name="sd" id="configuration1" type="specific" device="HD" />
+ <configuration device="HD" id="config1" name="common" orientation="portrait" type="common"/>
+ <configuration orientation="landscape" name="sd" id="configuration1" type="specific" device="HD"/>
</mscreen>
<views startup="view1">
<view id="view1" indicator="true" screen_orientation="full_sensor" type="view">
<button align_v="fill" visible="true" weight_v="1" pack_h="49" weight_h="1" align_h="fill"
pack_w="210" disable="false" pack_x="406" pack_y="219" style="default" id="button1" text="Button">
<event connection_wrapper="connection_view1_button1_onclicked"
- function_name="view1_button1_onclicked" signal="clicked" target="view2" />
+ function_name="view1_button1_onclicked" signal="clicked" target="view2"/>
<variation config_ref="configuration1" visible="true" pack_w="210" pack_x="515"
- pack_h="49" pack_y="753" />
+ pack_h="49" pack_y="753"/>
</button>
</grid>
</view>
<pre class="prettyprint">
<mscreen>
- <configuration device="HD" id="config1" name="common" orientation="portrait" type="common" />
+ <configuration device="HD" id="config1" name="common" orientation="portrait" type="common"/>
</mscreen>
</pre>
<button align_v="fill" visible="true" weight_v="1" pack_h="49" weight_h="1"
align_h="fill" pack_w="210" disable="false" pack_x="406"
pack_y="219" style="default" id="button1" text="Button">
- <variation config_ref="configuration1" visible="true" pack_w="210" pack_x="515" pack_h="49" pack_y="753" />
+ <variation config_ref="configuration1" visible="true" pack_w="210" pack_x="515" pack_h="49" pack_y="753"/>
</button>
</pre>
align_h="fill" pack_w="210" disable="false" pack_x="406"
pack_y="219" style="default" id="button1" text="Button">
<event connection_wrapper="connection_view1_button1_onclicked" function_name="view1_button1_onclicked"
- signal="clicked" target="view2" />
+ signal="clicked" target="view2"/>
</button>
</pre>
<multibuttonentry align_v="fill" visible="true" weight_v="0" editable="true" pack_h="40" weight_h="0"
align_h="fill" expanded="false" pack_w="210" disable="false" pack_x="329"
pack_y="360" id="multibuttonentry1">
- <multibuttonentryitem id="multibuttonentryitem1" text="item" />
+ <multibuttonentryitem id="multibuttonentryitem1" text="item"/>
</multibuttonentry>
</pre>
icon_size="32" style="default" id="toolbar1"
transverse_expand="false" direction="horizontal">
<toolbaritem src="" disable="false" id="toolbaritem1" text="item"
- selected="false" />
+ selected="false"/>
<toolbaritem src="" disable="false" id="toolbaritem2" text="item"
- selected="false" />
+ selected="false"/>
</toolbar>
</pre>
<p>The panel on the right side of the Component Designer window can be used to modify the properties and parameters of the current context (such as an opened group, workspace mode, or selected part, state, or program). You can see and modify the values of a large number of properties, such as min, relative, map, part name, and content type (for demo).</p>
<p align="center"><strong>Figure: Properties</strong></p>
<p align="center"><img alt="Properties" src="../images/comp_des_properties.png" /></p>
-<p>All general properties that can be modified are described in the following sections. There are different properties for an opened group, demo mode, selected items, data, program, state, and part. Some user-friendly general behaviors, such as list filtering (hide other controls on certain values), popups, and highlights are covered as well.</p>
+<p>All general properties that can be modified are described in the following sections. There are different properties for an opened group, demo mode, selected items, data, program, state, and part. Some user-friendly general behaviors, such as list filtering (hide other controls on certain values), popups, and highlights are covered as well.</p>
<h3>Property Controls</h3>
<p>Properties consist of different controls:</p>
<ul>
</ul>
<p><strong>For example:</strong></p>
-<pre class="prettyprint"><datacontrol access="WriteOnly" providerid="http://uiapp.com/datacontrol/provider/uiapp" type="Sql"/>
+<pre class="prettyprint">
+<datacontrol access="WriteOnly" providerid="http://uiapp.com/datacontrol/provider/uiapp" type="Sql"/>
</pre>
<h2 name="icon" id="icon"><icon> Element</h2>
<p align="center"><img src="../images/prjm_combi_structure_glview11cube.png" alt="Structure of the GLView11Cube" /></p>
<p>The GLView11Cube application (single screen) does not have the naviframe in the core UI component layer. Thus, the UI components that make up the screen are connected to the first elementary window object. Similarly, the UI Builder view system also creates the <code>root_container</code> through the window; however, it defines the structure to manage the view in the naviframe of the window object.</p>
-<p>To design the ported view, you must modify the ported source file (<code>SettingsUIwithUIB/src/glview11cube.c</code>) and the new user view file (<code>SettingsUIwithUIB/src/user_view/uib_glview11cube_view.c</code>).</p>
+<p>To design the ported view, you must modify the ported source file (<code>SettingsUIwithUIB/src/glview11cube.c</code>) and the new user view file (<code>SettingsUIwithUIB/src/user_view/uib_glview11cube_view.c</code>).</p>
<p>To modify the ported file (<code>SettingsUIwithUIB/src/glview11cube.c</code>):</p>
<ol>
<p>To debug a coredump archive:</p>
<ol>
<li>Connect a device to your computer.</li>
-<li>In the <strong>Connection Explorer</strong> view, select the device for which a coredump archive to debug exists (for example, <code>/opt/usr/share/crash/</code>).</li>
+<li>In the <strong>Connection Explorer</strong> view, select the device for which a coredump archive to debug exists (for example, <code>/opt/usr/share/crash/</code>).</li>
<li>In the <strong>Project Explorer</strong> view, right-click the project and select <strong>Debug As > Tizen Platform Project – Coredump</strong>.</li>
<li>In the <strong>Launch Configuration</strong> dialog, select a core dumped file (<code>*.coredump</code>) and CS file (<code>*.cs</code>) by clicking <strong>Remote Browse</strong> or <strong>Local Browse</strong>.
<p align="center"><img alt="Selecting files" src="../images/platform_codedump_files.png" /></p>
</tr>
<tr>
<td>Represents the root element of a configuration document. <p><strong>Expected children:</strong></p>
-<p><code><access></code>, <code><tizen:account></code>, <code><tizen:app-control></code>, <code><tizen:application></code>, <code><author></code>, <code><content></code>, <code><tizen:content></code>, <code><description></code>, <code><feature></code>, <code><icon></code>, <code><license></code>, <code><name></code>, <code><preference></code>, <code><tizen:privilege></code>, <code><tizen:profile></code>, and <code><tizen:setting></code></p>
+<p><code><access></code>, <code><tizen:account></code>, <code><tizen:app-control></code>, <code><tizen:application></code>, <code><author></code>, <code><content></code>, <code><tizen:content></code>, <code><description></code>, <code><feature></code>, <code><icon></code>, <code><license></code>, <code><name></code>, <code><preference></code>, <code><tizen:privilege></code>, <code><tizen:profile></code>, and <code><tizen:setting></code></p>
<p><strong>Attributes:</strong></p>
<ul><li><code>xml:lang</code></li>
<li><code>dir</code></li>
<table>
<tbody>
<tr>
- <th><tizen:account /> element</th>
+ <th><tizen:account/> element</th>
</tr>
<tr>
<td>Used to register account provider information.
<ul>
<li><code>multiple-account-support</code> <p>Mandatory; indicates whether multiple accounts are supported (available values: <code>true</code>, <code>false</code>)</p></li>
- </ul><p><strong>Example:</strong> </p><pre class="prettyprint"><tizen:account multiple-account-support="false">
+ </ul><p><strong>Example:</strong> </p>
+<pre class="prettyprint">
+<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></pre>
+</tizen:account>
+</pre>
</td>
</tr>
</tbody></table>
<table>
<tbody>
<tr>
- <th><tizen:allow-navigation /> element</th>
+ <th><tizen:allow-navigation/> element</th>
</tr>
<tr>
<td>Used to define a list of URL domains that are allowed to be navigated in using the Web application.
<li>0 or more
<p>If more than 1, the first occurrence is applied.</p></li>
</ul>
-<p><strong>Example:</strong> </p><pre class="prettyprint"><tizen:allow-navigation>tizen.org *.tizen.org<tizen:allow-navigation/></pre>
+<p><strong>Example:</strong> </p>
+<pre class="prettyprint">
+<tizen:allow-navigation>tizen.org *.tizen.org<tizen:allow-navigation/>
+</pre>
</td>
</tr>
</tbody></table>
<table>
<tbody>
<tr>
- <th><tizen:app-control /> element</th>
+ <th><tizen:app-control/> element</th>
</tr>
<tr>
<td>Used to indicate that the Web application can handle a specific operation with the specified MIME type and URI. For more information, see <a href="../../../org.tizen.guides/html/web/app_management/app_controls_w.htm">Application Information and Controls</a>.
<li><code>operation</code> <p>Mandatory; string that defines the action to be performed</p></li>
<li><code>uri</code> and <code>mime</code><p>Optional; additional parameters used for resolving application control requests</p></li>
- </ul><p><strong>Example:</strong> </p><pre class="prettyprint"><tizen:app-control>
+ </ul><p><strong>Example:</strong> </p>
+<pre class="prettyprint">
+<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:app-control></pre>
+</tizen:app-control>
+</pre>
</td>
</tr>
</tbody></table>
<table>
<tbody>
<tr>
- <th><tizen:application /> element</th>
+ <th><tizen:application/> element</th>
</tr>
<tr>
<td>Used to uniquely identify a Tizen application.
The <code>launch_mode</code> attribute is supported from Tizen 2.4 onwards. If the <code>required_version</code> in the application's <code>config.xml</code> file is set to a version older than Tizen 2.4, and the <code>launch_mode</code> attribute is used, the application installation fails.
</div>
</li>
- </ul><p><strong>Example:</strong></p><pre class="prettyprint"><tizen:application id="1234abcDEF.projectname"
+ </ul><p><strong>Example:</strong></p>
+<pre class="prettyprint">
+<tizen:application id="1234abcDEF.projectname"
package="1234abcDEF"
required_version="2.4"
- launch_mode="caller" /></pre>
+ launch_mode="caller"/>
+</pre>
</td>
</tr>
</tbody></table>
<table>
<tbody>
<tr>
- <th><tizen:background-category /> element</th>
+ <th><tizen:background-category/> element</th>
</tr>
<tr>
<td>Used to represent the category of the application that is allowed to run on the background.
<ul>
<li><code>value</code> <p>Mandatory; <a href="../../../org.tizen.guides/html/native/app_management/efl_ui_app_n.htm#allow_bg_table">background category</a></p></li>
</ul><p><strong>Example:</strong> </p>
- <pre class="prettyprint"><tizen:background-category value="media" /></pre>
+<pre class="prettyprint">
+<tizen:background-category value="media"/>
+</pre>
</td>
</tr>
</tbody></table>
<table>
<tbody>
<tr>
- <th><tizen:content /> element</th>
+ <th><tizen:content/> element</th>
</tr>
<tr>
<td>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.
- <p>If the start page is contained in the widget package, it is defined with the <a href="#content_element"><code><content></code> W3C element</a>. If both <code><content></code> and <code><tizen:content /></code> elements are defined, the <code><tizen:content /></code> element is used.</p>
+ <p>If the start page is contained in the widget package, it is defined with the <a href="#content_element"><code><content></code> W3C element</a>. If both <code><content></code> and <code><tizen:content/></code> elements are defined, the <code><tizen:content/></code> element is used.</p>
<p><strong>Occurrences:</strong> </p>
<ul>
<li>0 or more
- <p>If more than 1 <code><tizen:content /></code> element is specified, the first instance of the element is used.</p></li>
+ <p>If more than 1 <code><tizen:content/></code> element is specified, the first instance of the element is used.</p></li>
</ul>
<p><strong>Attributes:</strong> </p>
<ul>
<li><code>src</code><p>Mandatory; URI of the external start page</p></li>
</ul>
- <p><strong>Example:</strong> </p><pre class="prettyprint"><tizen:content src="https://www.tizen.org/" /></pre>
+ <p><strong>Example:</strong> </p>
+<pre class="prettyprint">
+<tizen:content src="https://www.tizen.org/"/>
+</pre>
</td>
</tr>
</tbody></table>
<table>
<tbody>
<tr>
- <th><tizen:content-security-policy /> element</th>
+ <th><tizen:content-security-policy/> element</th>
</tr>
<tr>
<td>Used to define an additional content security policy for a packaged or hosted application.
<li>0 or more
<p>If more than 1, the first occurrence is applied.</p></li>
</ul>
-<p><strong>Example:</strong> </p><pre class="prettyprint"><tizen:content-security-policy>script-src 'self'</tizen:content-security-policy></pre>
+<p><strong>Example:</strong> </p>
+<pre class="prettyprint">
+<tizen:content-security-policy>script-src 'self'</tizen:content-security-policy>
+</pre>
</td>
</tr>
</tbody></table>
<table>
<tbody>
<tr>
- <th><tizen:content-security-policy-report-only /> element</th>
+ <th><tizen:content-security-policy-report-only/> element</th>
</tr>
<tr>
<td>Used to define an additional content security policy for a packaged or hosted application for monitoring purposes.
<li>0 or more
<p>If more than 1, the first occurrence is applied.</p></li>
</ul>
-<p><strong>Example:</strong> </p><pre class="prettyprint"><tizen:content-security-policy-report-only>
+<p><strong>Example:</strong> </p>
+<pre class="prettyprint">
+<tizen:content-security-policy-report-only>
script-src 'self'; report-uri="http://example.com/report.cgi"
-</tizen:content-security-policy-report-only></pre>
+</tizen:content-security-policy-report-only>
+</pre>
</td>
</tr>
</tbody></table>
<table>
<tbody>
<tr>
- <th><feature /> element</th>
+ <th><feature/> element</th>
</tr>
<tr>
<td>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.
<div class="note">
<strong>Note</strong>
- Even though the <code><feature /></code> element is defined in the Widget Packaging and XML Configuration guidelines, in Tizen, an extended version is used.
+ Even though the <code><feature/></code> element is defined in the Widget Packaging and XML Configuration guidelines, in Tizen, an extended version is used.
</div>
<p><strong>Occurrences:</strong> </p>
<p><strong>Attributes:</strong> </p>
<ul>
<li><code>name</code> <p>Mandatory; <a href="../../../org.tizen.training/html/web/process/setting_properties_w.htm#feature">feature key</a> URI</p></li>
- </ul><p><strong>Example:</strong> </p><pre class="prettyprint"><feature name="http://tizen.org/feature/network.bluetooth" /></pre>
+ </ul><p><strong>Example:</strong> </p>
+<pre class="prettyprint">
+<feature name="http://tizen.org/feature/network.bluetooth"/>
+</pre>
</td>
</tr>
</tbody></table>
<table>
<tbody>
<tr>
- <th><tizen:metadata /> element</th>
+ <th><tizen:metadata/> element</th>
</tr>
<tr>
<td>Used to define metadata information shared with other Web applications. The defined metadata can be accessed (read-only) through the Tizen <a href="../../../org.tizen.web.apireference/html/device_api/mobile/tizen/application.html">Application</a> API.
<p>The maximum length can be limited to 8192 bytes. In this case, leftover bytes are ignored.</p>
</li>
- </ul><p><strong>Example:</strong> </p><pre class="prettyprint"><tizen:metadata key="key1"/>
-<tizen:metadata key="key2" value="value/></pre>
+ </ul><p><strong>Example:</strong> </p>
+<pre class="prettyprint">
+<tizen:metadata key="key1"/>
+<tizen:metadata key="key2" value="value/>
+</pre>
</td>
</tr>
</tbody></table>
<table>
<tbody>
<tr>
- <th><tizen:privilege /> element</th>
+ <th><tizen:privilege/> element</th>
</tr>
<tr>
<td>Used to get the required API access privileges for the Web application.
<p><strong>Attributes:</strong> </p>
<ul>
<li><code>name</code><p> Mandatory; URI of the Device API privilege</p></li>
- </ul><p><strong>Example:</strong> </p><pre class="prettyprint"><tizen:privilege name="http://tizen.org/privilege/application.launch" /></pre>
+ </ul><p><strong>Example:</strong> </p>
+<pre class="prettyprint">
+<tizen:privilege name="http://tizen.org/privilege/application.launch"/>
+</pre>
</td>
</tr>
</tbody></table>
<table>
<tbody>
<tr>
- <th><tizen:profile /> element</th>
+ <th><tizen:profile/> element</th>
</tr>
<tr>
<td>Used to define the application profile.
<p><strong>Attributes:</strong> </p>
<ul>
<li><code>name</code> <p>Mandatory; string</p></li>
- </ul><p><strong>Example:</strong> </p><pre class="prettyprint"><tizen:profile name="mobile" /></pre>
+ </ul><p><strong>Example:</strong> </p>
+<pre class="prettyprint">
+<tizen:profile name="mobile"/>
+</pre>
</td>
</tr>
</tbody></table>
<table>
<tbody>
<tr>
- <th><tizen:setting /> element</th>
+ <th><tizen:setting/> element</th>
</tr>
<tr>
<td>Used to define additional application settings.
<li><code>hwkey-event</code> <p>Optional; a hardware key event is sent to the Web application when the user presses the hardware key (available values: <code>enable</code> (default), <code> disable</code>)</p><p>If this option is enabled, the <code>tizenhwkey</code> custom event is sent to the Web application. The <code>tizenhwkey</code> event object has a <code>keyName</code> attribute (available values: <code>menu</code> and <code>back</code>).</p></li>
- </ul><p><strong>Example:</strong> </p><pre class="prettyprint">
+ </ul><p><strong>Example:</strong> </p>
+<pre class="prettyprint">
<!--Viewport orientation is locked to "landscape"-->
-<tizen:setting screen-orientation="landscape" />
+<tizen:setting screen-orientation="landscape"/>
<!--Context menu is not displayed-->
-<tizen:setting context-menu="disable" />
+<tizen:setting context-menu="disable"/>
<!--Web application execution is not suspended-->
<!--when the application is sent to the background-->
-<tizen:setting background-support="enable" />
+<tizen:setting background-support="enable"/>
<!--Web applications resources are stored encrypted by the WRT-->
-<tizen:setting encryption="enable" />
+<tizen:setting encryption="enable"/>
<!--Installation location is set to "internal-only"-->
-<tizen:setting install-location="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" /></pre>
+<tizen:setting hwkey-event="enable"/>
+</pre>
</td>
</tr>
</tbody></table>
<table>
<tbody>
<tr>
- <th><tizen:allow-navigation /> element</th>
+ <th><tizen:allow-navigation/> element</th>
</tr>
<tr>
<td>Used to define a list of URL domains that are allowed to be navigated in using the Web application.
<li>0 or more
<p>If more than 1, the first occurrence is applied.</p></li>
</ul>
-<p><strong>Example:</strong> </p><pre class="prettyprint"><tizen:allow-navigation>tizen.org *.tizen.org<tizen:allow-navigation/></pre>
+<p><strong>Example:</strong> </p>
+<pre class="prettyprint">
+<tizen:allow-navigation>tizen.org *.tizen.org<tizen:allow-navigation/>
+</pre>
</td>
</tr>
</tbody></table>
<table>
<tbody>
<tr>
- <th><tizen:app-control /> element</th>
+ <th><tizen:app-control/> element</th>
</tr>
<tr>
<td>Used to indicate that the Web application can handle a specific operation with the specified MIME type and URI. For more information, see <a href="../../../org.tizen.guides/html/web/app_management/app_controls_w.htm">Application Information and Controls</a>.
<li><code>operation</code> <p>Mandatory; string that defines the action to be performed</p></li>
<li><code>uri</code> and <code>mime</code><p>Optional; additional parameters used for resolving application control requests</p></li>
- </ul><p><strong>Example:</strong> </p><pre class="prettyprint"><tizen:app-control>
+ </ul><p><strong>Example:</strong> </p>
+<pre class="prettyprint">
+<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:app-control></pre>
+</tizen:app-control>
+</pre>
</td>
</tr>
</tbody></table>
<table>
<tbody>
<tr>
- <th><tizen:app-widget /> element</th>
+ <th><tizen:app-widget/> element</th>
</tr>
<tr>
<td>Used to define the basic information about a Web widget.
</ul>
<p><strong>Expected children:</strong> </p>
<ul>
- <li><a href="#ww_widget-label"><tizen:widget-label /></a></li>
- <li><a href="#ww_widget-content"><tizen:widget-content /></a></li>
- <li><a href="#ww_widget-metadata"><tizen:widget-metadata /></a></li>
+ <li><a href="#ww_widget-label"><tizen:widget-label/></a></li>
+ <li><a href="#ww_widget-content"><tizen:widget-content/></a></li>
+ <li><a href="#ww_widget-metadata"><tizen:widget-metadata/></a></li>
</ul>
<p><strong>Attributes:</strong> </p>
<ul>
<table id="ww_widget-label">
<tbody>
<tr>
- <th><tizen:widget-label /> element</th>
+ <th><tizen:widget-label/> element</th>
</tr>
<tr>
<td>Used to define the name of Web widget.
<table id="ww_widget-content">
<tbody>
<tr>
- <th><tizen:widget-content /> element</th>
+ <th><tizen:widget-content/> element</th>
</tr>
<tr>
<td>Used to define the starting page of the Web widget.
</ul>
<p><strong>Expected children:</strong> </p>
<ul>
- <li><a href="#ww_widget-size"><tizen:widget-size /></a></li>
+ <li><a href="#ww_widget-size"><tizen:widget-size/></a></li>
</ul>
<p><strong>Attributes:</strong> </p>
<ul>
<table id="ww_widget-size">
<tbody>
<tr>
- <th><tizen:widget-size /> element</th>
+ <th><tizen:widget-size/> element</th>
</tr>
<tr>
<td>Used to define the size of the Web widget.
<table id="ww_widget-metadata">
<tbody>
<tr>
- <th><tizen:widget-metadata /> element</th>
+ <th><tizen:widget-metadata/> element</th>
</tr>
<tr>
<td>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.
<table>
<tbody>
<tr>
- <th><tizen:application /> element</th>
+ <th><tizen:application/> element</th>
</tr>
<tr>
<td> Used to uniquely identify a Tizen wearable application.
The <code>launch_mode</code> attribute is supported from Tizen 2.4 onwards. If the <code>required_version</code> in the application's <code>config.xml</code> file is set to a version older than Tizen 2.4, and the <code>launch_mode</code> attribute is used, the application installation fails.
</div>
</li>
- </ul><p><strong>Example:</strong> </p><pre class="prettyprint"><tizen:application id="1234abcDEF.projectname"
+ </ul><p><strong>Example:</strong> </p>
+<pre class="prettyprint">
+<tizen:application id="1234abcDEF.projectname"
package="1234abcDEF"
required_version="2.4"
- ambient_support="enable" /></pre>
+ ambient_support="enable"/>
+</pre>
</td>
</tr>
</tbody></table>
<table>
<tbody>
<tr>
- <th><tizen:background-category /> element</th>
+ <th><tizen:background-category/> element</th>
</tr>
<tr>
<td>Used to represent the category of the application that is allowed to run on the background.
<ul>
<li><code>value</code> <p>Mandatory; <a href="../../../org.tizen.guides/html/native/app_management/efl_ui_app_n.htm#allow_bg_table">background category</a></p></li>
</ul><p><strong>Example:</strong> </p>
- <pre class="prettyprint"><tizen:background-category value="media" /></pre>
+<pre class="prettyprint">
+<tizen:background-category value="media"/>
+</pre>
</td>
</tr>
</tbody></table>
<table>
<tbody>
<tr>
- <th><tizen:category /> element</th>
+ <th><tizen:category/> element</th>
</tr>
<tr>
<td>Used to define the categories to which the service application belongs.
<p><strong>Attributes:</strong> </p>
<ul>
<li><code>name</code> <p>Mandatory; string</p></li>
- </ul><p><strong>Example:</strong> </p><pre class="prettyprint"><tizen:category name="http://tizen.org/category/wearable_clock" /></pre>
+ </ul><p><strong>Example:</strong> </p>
+<pre class="prettyprint">
+<tizen:category name="http://tizen.org/category/wearable_clock"/>
+</pre>
</td>
</tr>
</tbody></table>
<table>
<tbody>
<tr>
- <th><tizen:content /> element</th>
+ <th><tizen:content/> element</th>
</tr>
<tr>
<td>Used to define the start page to be hosted on an external server.
<li><code>src</code> <p>Mandatory; URI of an external start page</p></li>
- </ul><p><strong>Example:</strong> </p><pre class="prettyprint">
-<tizen:content src="https://www.tizen.org"/></pre>
+ </ul><p><strong>Example:</strong> </p>
+<pre class="prettyprint">
+<tizen:content src="https://www.tizen.org"/>
+</pre>
</td>
</tr>
</tbody></table>
<table>
<tbody>
<tr>
- <th><tizen:content-security-policy /> element</th>
+ <th><tizen:content-security-policy/> element</th>
</tr>
<tr>
<td>Used to define an additional content security policy for a packaged or hosted application.
<li>0 or more
<p>If more than 1, the first occurrence is applied.</p></li>
</ul>
-<p><strong>Example:</strong> </p><pre class="prettyprint"><tizen:content-security-policy>script-src 'self'</tizen:content-security-policy></pre>
+<p><strong>Example:</strong> </p>
+<pre class="prettyprint">
+<tizen:content-security-policy>script-src 'self'</tizen:content-security-policy>
+</pre>
</td>
</tr>
</tbody></table>
<table>
<tbody>
<tr>
- <th><tizen:content-security-policy-report-only /> element</th>
+ <th><tizen:content-security-policy-report-only/> element</th>
</tr>
<tr>
<td>Used to define an additional content security policy for a packaged or hosted application for monitoring purposes.
<li>0 or more
<p>If more than 1, the first occurrence is applied.</p></li>
</ul>
-<p><strong>Example:</strong> </p><pre class="prettyprint"><tizen:content-security-policy-report-only>
+<p><strong>Example:</strong> </p>
+<pre class="prettyprint">
+<tizen:content-security-policy-report-only>
script-src 'self'; report-uri="http://example.com/report.cgi"
-</tizen:content-security-policy-report-only></pre>
+</tizen:content-security-policy-report-only>
+</pre>
</td>
</tr>
</tbody></table>
<table>
<tbody>
<tr>
- <th><feature /> element</th>
+ <th><feature/> element</th>
</tr>
<tr>
<td>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.
<div class="note">
<strong>Note</strong>
- Even though the <code><feature /></code> element is defined in the Widget Packaging and XML Configuration guidelines, in Tizen, an extended version is used.
+ Even though the <code><feature/></code> element is defined in the Widget Packaging and XML Configuration guidelines, in Tizen, an extended version is used.
</div>
<p><strong>Occurrences:</strong> </p>
<p><strong>Attributes:</strong> </p>
<ul>
<li><code>name</code> <p>Mandatory; <a href="../../../org.tizen.training/html/web/process/setting_properties_w.htm#feature">feature key</a> URI</p></li>
- </ul><p><strong>Example:</strong> </p><pre class="prettyprint"><feature name="http://tizen.org/feature/network.bluetooth" /></pre>
+ </ul><p><strong>Example:</strong> </p>
+<pre class="prettyprint">
+<feature name="http://tizen.org/feature/network.bluetooth"/>
+</pre>
</td>
</tr>
</tbody></table>
<table>
<tbody>
<tr>
- <th><tizen:ime /> element</th>
+ <th><tizen:ime/> element</th>
</tr>
<tr>
<td>Used to define the properties of IME (Input Method Editor) type application, which is used when you want to create your own keyboard module for Tizen platform.
</div>
</li>
</ul>
- <p><strong>Example:</strong> </p><pre class="prettyprint"><tizen:ime>
+ <p><strong>Example:</strong> </p>
+<pre class="prettyprint">
+<tizen:ime>
<tizen:uuid>6135122a-a428-40d2-8feb-a75f462c202c</tizen:uuid>
<tizen:languages>
<tizen:language>en-us</tizen:language>
</tizen:languages>
</tizen:ime>
-<tizen:category name="http://tizen.org/category/ime"/></pre>
+<tizen:category name="http://tizen.org/category/ime"/>
+</pre>
</td>
</tr>
</tbody></table>
<table id="ww_language">
<tbody>
<tr>
- <th><tizen:language /> element</th>
+ <th><tizen:language/> element</th>
</tr>
<tr>
<td>Used to define the supported input language of the current IME type application.
<ul>
<li>1 or more</li>
</ul>
- <p><strong>Example:</strong> </p><pre class="prettyprint"><tizen:languages>
+ <p><strong>Example:</strong> </p>
+<pre class="prettyprint">
+<tizen:languages>
<tizen:language>en-us</tizen:language>
<tizen:language>de-de</tizen:language>
-</tizen:languages></pre>
+</tizen:languages>
+</pre>
</td>
</tr>
</tbody></table>
<table>
<tbody>
<tr>
- <th><tizen:metadata /> element</th>
+ <th><tizen:metadata/> element</th>
</tr>
<tr>
<td>Used to define metadata information shared with other Web applications. The defined metadata can be accessed (read-only) through the Tizen <a href="../../../org.tizen.web.apireference/html/device_api/wearable/tizen/application.html">Application</a> API.
<p>Optional; string.</p>
<p>The maximum length can be limited to 8192 bytes. In that case, leftover bytes are ignored.</p>
</li>
- </ul><p><strong>Example:</strong> </p><pre class="prettyprint"><tizen:metadata key="key1"/>
-<tizen:metadata key="key2" value="value/></pre>
+ </ul><p><strong>Example:</strong> </p>
+<pre class="prettyprint">
+<tizen:metadata key="key1"/>
+<tizen:metadata key="key2" value="value/>
+</pre>
</td>
</tr>
</tbody></table>
<table>
<tbody>
<tr>
- <th><tizen:privilege /> element</th>
+ <th><tizen:privilege/> element</th>
</tr>
<tr>
<td>Used to get the required API access privileges for the Web application.
<p><strong>Attributes:</strong> </p>
<ul>
<li><code>name</code><p> Mandatory; URI of the Device API privilege</p></li>
- </ul><p><strong>Example:</strong> </p><pre class="prettyprint"><tizen:privilege name="http://tizen.org/privilege/application.launch" /></pre>
+ </ul><p><strong>Example:</strong> </p>
+<pre class="prettyprint">
+<tizen:privilege name="http://tizen.org/privilege/application.launch"/>
+</pre>
</td>
</tr>
</tbody></table>
<table>
<tbody>
<tr>
- <th><tizen:profile /> element</th>
+ <th><tizen:profile/> element</th>
</tr>
<tr>
<td>Used to define the application profile.
<p><strong>Attributes:</strong> </p>
<ul>
<li><code>name</code> <p>Mandatory; string</p></li>
- </ul><p><strong>Example:</strong> </p><pre class="prettyprint"><tizen:profile name="wearable" /></pre>
+ </ul><p><strong>Example:</strong> </p>
+<pre class="prettyprint">
+<tizen:profile name="wearable"/>
+</pre>
</td>
</tr>
</tbody></table>
<table>
<tbody>
<tr>
- <th><tizen:setting /> element</th>
+ <th><tizen:setting/> element</th>
</tr>
<tr>
<td>Used to define additional application settings.
<li><code>hwkey-event</code> <p>Optional; a hardware key event is sent to the Web application when the user presses the hardware key (available values: <code>enable</code> (default), <code>disable</code>)</p><p>If this option is enabled, the <code>tizenhwkey</code> custom event is sent to the Web application. The <code>tizenhwkey</code> event object has a <code>keyName</code> attribute (available value: <code>back</code>).</p></li>
- </ul><p><strong>Example:</strong> </p><pre class="prettyprint">
-<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" />
+ </ul><p><strong>Example:</strong> </p>
+<pre class="prettyprint">
+<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"/>
</pre>
</td>
</tr>
<table>
<tbody>
<tr>
- <th><tizen:service /> element</th>
+ <th><tizen:service/> element</th>
</tr>
<tr>
<td>Used to define Web Service Application.
</ul>
<p><strong>Expected children:</strong> </p>
<ul>
- <li><a href="#ww_service-content"><tizen:content /></a></li>
- <li><a href="#ww_service-name"><tizen:name /></a></li>
- <li><a href="#ww_service-icon"><tizen:icon /></a></li>
- <li><a href="#ww_service-description"><tizen:description /></a></li>
- <li><a href="#ww_service-metadata"><tizen:metadata /></a></li>
- <li><a href="#ww_service-category"><tizen:category /></a></li>
+ <li><a href="#ww_service-content"><tizen:content/></a></li>
+ <li><a href="#ww_service-name"><tizen:name/></a></li>
+ <li><a href="#ww_service-icon"><tizen:icon/></a></li>
+ <li><a href="#ww_service-description"><tizen:description/></a></li>
+ <li><a href="#ww_service-metadata"><tizen:metadata/></a></li>
+ <li><a href="#ww_service-category"><tizen:category/></a></li>
</ul>
<p><strong>Attributes:</strong> </p>
<ul>
<li><code>auto-restart</code> <p>Optional; sets whether the service application is relaunched automatically when it is terminated (available values: <code>true</code>, <code>false</code> (default))</p></li>
</ul>
- <p><strong>Example:</strong> </p><pre class="prettyprint"><tizen:service id="webService.application" auto-restart="true" on-boot="false">
+ <p><strong>Example:</strong> </p>
+<pre class="prettyprint">
+<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></pre>
+<tizen:service>
+</pre>
</td>
</tr>
</tbody></table>
<table id="ww_service-content">
<tbody>
<tr>
- <th><tizen:content /> element</th>
+ <th><tizen:content/> element</th>
</tr>
<tr>
<td>Used to define the start page of the Web Service Application.
<table id="ww_service-name">
<tbody>
<tr>
- <th><tizen:name /> element</th>
+ <th><tizen:name/> element</th>
</tr>
<tr>
<td>Used to define the name of Web Service Application.
<table id="ww_service-icon">
<tbody>
<tr>
- <th><tizen:icon /> element</th>
+ <th><tizen:icon/> element</th>
</tr>
<tr>
<td>Used to define the icon of Web Service Application.
<table id="ww_service-description">
<tbody>
<tr>
- <th><tizen:description /> element</th>
+ <th><tizen:description/> element</th>
</tr>
<tr>
<td>Used to define the description of the Web Service Application.
<table id="ww_service-metadata">
<tbody>
<tr>
- <th><tizen:metadata /> element</th>
+ <th><tizen:metadata/> element</th>
</tr>
<tr>
<td>Used to define metadata information shared with other Web Applications. The defined metadata can be accessed (read-only) through the Tizen Application API.
<table id="ww_service-category">
<tbody>
<tr>
- <th><tizen:category /> element</th>
+ <th><tizen:category/> element</th>
</tr>
<tr>
<td>Used to define the categories that the service application belongs to.
<p>The JSA displays the following message:</p>
-<pre class="prettyprint">[Coding Rule] Use var to declare the variable foo.</pre>
+<pre class="prettyprint">
+[Coding Rule] Use var to declare the variable foo.
+</pre>
<h4>Rule 2. Do Not Declare an Arguments Array within Functions</h4>
<p>The JSA displays the following message:</p>
-<pre class="prettyprint">[Coding Rule] Do not declare arguments Array as variables in functions. </pre>
+<pre class="prettyprint">
+[Coding Rule] Do not declare arguments Array as variables in functions.
+</pre>
<h4>Rule 3. Do Not Capture Variables in Functions</h4>
test();
/* Third return */
-test();</pre>
+test();
+</pre>
<p>The JSA displays the following message:</p>
-<pre class="prettyprint">[Coding Rule] Do not capture the variable x in a closure.</pre>
+<pre class="prettyprint">
+[Coding Rule] Do not capture the variable x in a closure.
+</pre>
<h4>Rule 4. Do Not Use Extra Semicolons</h4>
<p>The JSA displays the following message:</p>
-<pre class="prettyprint">[Coding Rule] Do not use extra semicolons.</pre>
+<pre class="prettyprint">
+[Coding Rule] Do not use extra semicolons.
+</pre>
<h4>Rule 5. Do Not Use the Delete Keyword</h4>
var obj = new Obj();
/* Deleting properties of objects can make the performance of the program worse */
-delete obj.value;</pre>
+delete obj.value;
+</pre>
<p>The JSA displays the following message:</p>
-<pre class="prettyprint">[Coding Rule] Use var to declare the variable value.</pre>
+<pre class="prettyprint">
+[Coding Rule] Use var to declare the variable value.
+</pre>
<h4>Rule 6. Do Not Use Multi-line Literals</h4>
<p>The JSA displays the following message:</p>
-<pre class="prettyprint">[Coding Rule] Do not use multi-line string literals. </pre>
+<pre class="prettyprint">
+[Coding Rule] Do not use multi-line string literals.
+</pre>
<h4>Rule 7. Do Not Use Array or Object Constructors</h4>
<p>Use array and object literals instead of their constructors to avoid confusing and unexpected results.</p>
-<p>In the following example, the array <code>arr2</code> that has 3 values (1, 2, and 3) can be created using an array constructor. In the same way, if the array <code>arr1</code> that has a single value (1) is created using an array constructor, it is the array with the length 1, not arr[0] is 1.</p>
+<p>In the following example, the array <code>arr2</code> that has 3 values (1, 2, and 3) can be created using an array constructor. In the same way, if the array <code>arr1</code> that has a single value (1) is created using an array constructor, it is the array with the length 1, not arr[0] is 1.</p>
<p>This rule is introduced by the Google Javascript Style Guide. They say that "Array constructors are error-prone due to their arguments".</p>
<p>The JSA displays the following message:</p>
-<pre class="prettyprint">[Coding Rule] Do not use constructors for an Array. </pre>
+<pre class="prettyprint">
+[Coding Rule] Do not use constructors for an Array.
+</pre>
<h4>Rule 8. Do Not Modify the Prototypes of Built-in Objects</h4>
<p>The JSA displays the following message:</p>
-<pre class="prettyprint">[Coding Rule] Do not modify the prototype of a built-in object Object. </pre>
+<pre class="prettyprint">
+[Coding Rule] Do not modify the prototype of a built-in object Object.
+</pre>
<h4>Rule 9. Do Not Convert Wrapper Objects to Primitives</h4>
<p>The JSA displays the following message:</p>
-<pre class="prettyprint">[Coding Rule] Do not convert a wrapper object Boolean to a primitive value.</pre>
+<pre class="prettyprint">
+[Coding Rule] Do not convert a wrapper object Boolean to a primitive value.
+</pre>
<h4>Rule 10. Do Not Use the <code>for-in</code> Structure with Arrays</h4>
<p>The JSA displays the following message:</p>
-<pre class="prettyprint">[Coding Rule] Do not use for-in with arrays. </pre>
+<pre class="prettyprint">
+[Coding Rule] Do not use for-in with arrays.
+</pre>
<h4>Rule 11. Do Not Use Unclosed Braces</h4>
</pre>
<p>The JSA displays the following message:</p>
-<pre class="prettyprint">[Syntax Error]Missing closing brace } character.</pre>
+<pre class="prettyprint">
+[Syntax Error]Missing closing brace } character.
+</pre>
<h4>Rule 12. Do Not Use Unclosed Comments</h4>
</pre>
<p>The JSA displays the following message:</p>
-<pre class="prettyprint">[Syntax Error]Missing closing comment "*/".</pre>
+<pre class="prettyprint">
+[Syntax Error]Missing closing comment "*/".
+</pre>
<h4>Rule 13. Do Not Use Unclosed Strings</h4>
</pre>
<p>The JSA displays the following message:</p>
-<pre class="prettyprint">[Syntax Error]Missing closing single-quote ' character.</pre>
+<pre class="prettyprint">
+[Syntax Error]Missing closing single-quote ' character.
+</pre>
<h4>Rule 14. Do Not Omit Semicolons</h4>
</pre>
<p>The JSA displays the following message:</p>
-<pre class="prettyprint">[CodingRule] Do not omit semicolon at the end of a declaration.</pre>
+<pre class="prettyprint">
+[CodingRule] Do not omit semicolon at the end of a declaration.
+</pre>
<h4>Rule 15. Do Not Begin With Operators</h4>
</pre>
<p>The JSA displays the following message:</p>
-<pre class="prettyprint">[CodingRule] Do not begin a line with the operator =.</pre>
+<pre class="prettyprint">
+[CodingRule] Do not begin a line with the operator =.
+</pre>
<h4>Rule 16. Do Not Use Double-quoted Strings</h4>
</pre>
<p>The JSA displays the following message:</p>
-<pre class="prettyprint">[[CodingRule] Do not use double-quotes instead of single-quotes for string.</pre>
+<pre class="prettyprint">
+[CodingRule] Do not use double-quotes instead of single-quotes for string.
+</pre>
<h4>Rule 17. Do Not End With Commas In Literals</h4>
<p>In the following example, the last ',' must be removed. The JSA detects it and creates an alarm.</p>
<pre class="prettyprint">
-var abc = [1, 2, 3,];</pre>
+var abc = [1, 2, 3,];
+</pre>
<p>The JSA displays the following message:</p>
-<pre class="prettyprint">[CodingRule] Do not use extra comma at the end of object/array literals.</pre>
+<pre class="prettyprint">
+[CodingRule] Do not use extra comma at the end of object/array literals.
+</pre>
<h4>Rule 18. Do Not Use Wrong Opening Brace</h4>
</pre>
<p>The JSA displays the following message:</p>
-<pre class="prettyprint">[CodingRule] Opening brace '{' character should appear in the same line with the statement. </pre>
+<pre class="prettyprint">
+[CodingRule] Opening brace '{' character should appear in the same line with the statement.
+</pre>
<h3 id="api" name="api">Web API Usage Rules</h3>
<p>In the following example, the <code>tizen.alarm.gett()</code> function does not exist in the Tizen API, so the JSA detects it and creates an alarm.</p>
-<pre class="prettyprint">/* Mistyping get as gett */
-var alarm = tizen.alarm.gett(abs_alarm.id);</pre>
+<pre class="prettyprint">
+/* Mistyping get as gett */
+var alarm = tizen.alarm.gett(abs_alarm.id);
+</pre>
<p>The JSA displays the following message:</p>
-<pre class="prettyprint">[Web API Rule] Name gett is not found in the API AlarmManager.
-[Web API Rule] Reading absent property 'gett' of object 'tizen.alarm'.</pre>
+<pre class="prettyprint">
+[Web API Rule] Name gett is not found in the API AlarmManager.
+[Web API Rule] Reading absent property 'gett' of object 'tizen.alarm'.
+</pre>
<h4>Rule 2. Wrong Argument Number</h4>
<p>In the following example, the <code>tizen.filesystem.resolve()</code> function needs more than 1 argument. Since the number of arguments is 1, the JSA detects it and creates an alarm.</p>
-<pre class="prettyprint">/* The number of arguments is wrong (2 or more arguments required) */
+<pre class="prettyprint">
+/* The number of arguments is wrong (2 or more arguments required) */
tizen.filesystem.resolve('images'
- /* Missing error callback arguments */);</pre>
+ /* Missing error callback arguments */);
+</pre>
<p>The JSA displays the following message:</p>
-<pre class="prettyprint">[Web API Rule] Number of the arguments to tizen.filesystem.resolve is 1; provide arguments of size from 2 to 4.</pre>
+<pre class="prettyprint">
+[Web API Rule] Number of the arguments to tizen.filesystem.resolve is 1; provide arguments of size from 2 to 4.
+</pre>
<h4>Rule 3. Missing Error Handling</h4>
<p>The JSA displays the following message:</p>
-<pre class="prettyprint">[Web API Rule] Call to tizen.filesystem.resolve is missing an error callback; provide an error callback.</pre>
+<pre class="prettyprint">
+[Web API Rule] Call to tizen.filesystem.resolve is missing an error callback; provide an error callback.
+</pre>
<h4>Rule 4. Missing Exception Handling</h4>
<p>The JSA displays the following message:</p>
-<pre class="prettyprint">[Web API Rule] Function CalendarManager.prototype.getCalendars may raise an exception; call the function inside the try statement.</pre>
+<pre class="prettyprint">
+[Web API Rule] Function CalendarManager.prototype.getCalendars may raise an exception; call the function inside the try statement.
+</pre>
<h4>Rule 5. Wrong Argument Type</h4>
<p>The JSA displays the following message:</p>
-<pre class="prettyprint">[Web API Rule] Argument #1 of the function ContactManager.prototype.getAddressBooks is wrong; the expected type is AddressBookArraySuccessCallback.
-[Web API Rule] Argument #2 of the function ContactManager.prototype.getAddressBooks is wrong; the expected type is ErrorCallback.</pre>
+<pre class="prettyprint">
+[Web API Rule] Argument #1 of the function ContactManager.prototype.getAddressBooks is wrong; the expected type is AddressBookArraySuccessCallback.
+[Web API Rule] Argument #2 of the function ContactManager.prototype.getAddressBooks is wrong; the expected type is ErrorCallback.
+</pre>
<h4>Rule 6. Wrong Dictionary Type</h4>
<p>The JSA displays the following message:</p>
-<pre class="prettyprint">[Web API Rule] The property foo is not a member of the dictionary CantactNameInit.</pre>
+<pre class="prettyprint">
+[Web API Rule] The property foo is not a member of the dictionary ContactNameInit.
+</pre>
<h4>Rule 7. API Version Compatibility</h4>
<p>The JSA displays the following message:</p>
-<pre class="prettyprint">[Web API Rule] Tizen Wearable-2.3 API not support "open" API. It is defined in Tizen mobile-2.3.</pre>
+<pre class="prettyprint">
+[Web API Rule] Tizen Wearable-2.3 API not support "open" API. It is defined in Tizen mobile-2.3.
+</pre>
<h4>Rule 8. API Privilege Missing</h4>
<p>The JSA displays the following message:</p>
-<pre class="prettyprint">[Web API Rule] Tizen <code>tizen.application.launch</code> API need "http://tizen.org/privilege/application.launch" privilege in 'config.xml'.</pre>
+<pre class="prettyprint">
+[Web API Rule] Tizen <code>tizen.application.launch</code> API need "http://tizen.org/privilege/application.launch" privilege in 'config.xml'.
+</pre>
<h2 id="stalechecker" name="support">Using the Stale Object Checker</h2>
<manifest xmlns=http://tizen.org/ns/packages
package="org.tizen.application"
version="1.0.0"
- api-version="2.3"></pre>
+ api-version="2.3">
+</pre>
<h2 id="signature" name="signature">Signature</h2>
service_app_region_changed, &ad);
return service_app_main(argc, argv, &event_callback, ad);
-}</pre>
+}
+</pre>
<p>The <code>ecore_thread_feedback()</code> function allows the <code>download_thread_run_cb()</code> callback to call the <code>download_feedback_cb()</code> callback:</p>
/* Add a rectangle to the given Evas */
Evas_Object *rect = evas_object_rectangle_add(evas);
/* Set the general/main color of the Evas object to the given one */
-evas_object_color_set(rect, 255, 0, 0,192);
+evas_object_color_set(rect, 255, 0, 0, 192);
/* Move the Evas object to the given location inside its canvas viewpoint */
evas_object_move(rect, 50, 50);
/* Change the size of the Evas object */
<li>
<p>In the <code>RECORDER_STATE_RECORDING</code> state, you can pause or stop recording:</p>
<ul>
-<li>To pause recording, call the <code>recorder_pause()</code> function that changes the recorder state to <code>RECORDER_STATE_PAUSED</code>. In this state, you can resume or stop recording. To resume, call the <code>recorder_start()</code> function.
+<li>To pause recording, call the <code>recorder_pause()</code> function that changes the recorder state to <code>RECORDER_STATE_PAUSED</code>. In this state, you can resume or stop recording. To resume, call the <code>recorder_start()</code> function.
<pre class="prettyprint">
error_code = recorder_pause(rec_data.recorder);
</pre>
<p>After setting the feature information with the Web application configuration editor, you can see the added code in the <strong>Source</strong> tab.</p>
<p> The following example shows the setting in the <code>config.xml</code> file code:</p>
- <pre class="prettyprint">
+<pre class="prettyprint">
<tizen:feature name="http://tizen.org/feature/network.nfc"/>
</pre>
</ul>
<h3 id="protect" name="protect">Web Application Protection</h3>
- <p>For Web applications that explicitly turn on encryption (in <a href="../../../../org.tizen.studio/html/web_tools/config_editor_w.htm#mw_setting">mobile</a> and <a href="../../../../org.tizen.studio/html/web_tools/config_editor_w.htm#ww_setting">wearable</a> applications) using the <code><tizen:setting /></code> element in the configuration file, the Web Runtime provides the following protection features:</p>
+ <p>For Web applications that explicitly turn on encryption (in <a href="../../../../org.tizen.studio/html/web_tools/config_editor_w.htm#mw_setting">mobile</a> and <a href="../../../../org.tizen.studio/html/web_tools/config_editor_w.htm#ww_setting">wearable</a> applications) using the <code><tizen:setting/></code> element in the configuration file, the Web Runtime provides the following protection features:</p>
<ul>
<li>HTML, JavaScript, and CSS files of the Web application stored by the device are encrypted.</li>
<li>When the Web application is launched, the WRT decrypts all of its resources in a manner which is transparent to the Web application itself.</li>
<!DOCTYPE html>
<html>
<head>
- <meta charset="utf-8" />
+ <meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
<meta name="description" content="Tizen Mobile Web Basic Template"/>
<!DOCTYPE html>
<html>
<head>
- <meta charset="utf-8" />
+ <meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
<meta name="description" content="Tizen Mobile Web Basic Template"/>
<p>The Tizen Studio provides various project templates that make it easier for you to start coding your application. When you create a new project, you can select a specific template or sample. Based on the selection, the Tizen Web <a href="../../../../org.tizen.studio/html/web_tools/project_wizard_w.htm">Project Wizard</a> automatically creates basic functionalities that the application has to implement to be able to run. The default project files and folders are also created.</p>
-<h2 id="set" name="set" >Setting Project Properties</h2>
+<h2 id="set" name="set">Setting Project Properties</h2>
<p>After creating the application project, you can <a href="setting_properties_w.htm">configure the properties of the project and the Web application</a> to achieve the required functionality and features for your application.</p>
<p><a href="coding_app_w.htm">Code your application</a> in the Tizen Studio using the APIs defined in the Web <a href="../../../../org.tizen.web.apireference/html/web_api_reference.htm">API References</a>.</p>
<p>Once you have finished coding your application, you are ready to build your application.</p>
-<h2 id="build" name="build" >Building the Application</h2>
+<h2 id="build" name="build">Building the Application</h2>
<p>When the Tizen Studio builds an application, the following process is executed:</p>
<ol><li>Validation check for:
<li>Handle signing.</li></ol>
<p>Web application packaging process is based on the W3C packaging and configuration.</p>
<p>You can package a Web application using the <code>web-packaging</code> command in the <a href="../../../../org.tizen.studio/html/common_tools/command_line_interface.htm">Command Line Interface (CLI)</a>, which is a functional tool in the Tizen Studio:</p>
- <pre class="prettyprint">web-packaging project.wgt project/</pre>
+<pre class="prettyprint">
+web-packaging project.wgt project/
+</pre>
<p>The Tizen Studio provides the functionality to package a Web application quickly in the required format and to set the package properties.</p>
</ol>
<p>After saving the feature information with the Web application configuration editor, you can see the added code in the <strong>Source</strong> tab:</p>
- <pre class="prettyprint">
+<pre class="prettyprint">
<feature name="http://tizen.org/feature/network.nfc"/>
</pre>
<li>Click <strong>Finish</strong>.</li>
</ol>
<p>After saving the privilege information with the Web application configuration editor, you can see the added code in the <strong>Source</strong> tab:</p>
- <pre class="prettyprint"><tizen:privilege name="http://tizen.org/privilege/application.launch"/></pre>
+<pre class="prettyprint">
+<tizen:privilege name="http://tizen.org/privilege/application.launch"/>
+</pre>
<h3 id="policy" name="policy">Defining External Access Policies in the Policy Tab</h3>
</table>
<p>After setting the policy information with the Web application configuration editor, you can see the added code in the <strong>Source</strong> tab:</p>
- <pre class="prettyprint">
+<pre class="prettyprint">
<access origin="http://www.tizen.org" subdomains="true"/>
<tizen:allow-navigation>tizen.org *.tizen.org<tizen:allow-navigation/>
<tizen:content-security-policy>script-src 'self'</tizen:content-security-policy>
-<tizen:content-security-policy-report-only>script-src 'self';</tizen:content-security-policy-report-only></pre>
+<tizen:content-security-policy-report-only>script-src 'self';</tizen:content-security-policy-report-only>
+</pre>
<h3 id="localization" name="localization">Adding Localized Application Details in the Localization Tab</h3>
<p>To add a localized name, description, or license:</p>
<ul><li>In the <strong>Name</strong> panel, click <strong>+</strong>. Select the language, define the application name for that language, and click <strong>OK</strong>.
<p>The following example shows the setting in the <code>config.xml</code> file:</p>
- <pre class="prettyprint">
+<pre class="prettyprint">
<name xml:lang="en-gb">Lee</name>
</pre></li>
<li>In the <strong>Description</strong> panel, click <strong>+</strong>. Select the language, define the application description for that language, and click <strong>OK</strong>.
<p>The following example shows the setting in the <code>config.xml</code> file:</p>
- <pre class="prettyprint">
+<pre class="prettyprint">
<description xml:lang="en-gb">Widget</description>
</pre></li>
<li>In the <strong>License</strong> panel, click <strong>+</strong>. Select a language, define the license and license URI for that language, and click <strong>OK</strong>.
<p>The following example shows the setting in the <code>config.xml</code> file code:</p>
- <pre class="prettyprint">
+<pre class="prettyprint">
<license xml:lang="en-gb" href=" http://www.apache.org/licenses/LICENSE-2.0.html">
Apache License, Version 2.0
</license>
-</pre> </li>
+</pre></li>
</ul>
<p>You can localize a Web application to adapt to various languages and cultural environments by creating different Web application versions for different languages. For more information see <a href="../../../../org.tizen.studio/html/web_tools/web_localization_w.htm">Localizing Web Applications</a>.</p>
<p>To add preferences, click <strong>+</strong>. A new row appears in the table. Enter values in the <strong>Name</strong> and <strong>Value</strong> columns. You can set a preference as read-only by setting the <strong>Read-only</strong> column value as <strong>true</strong>.</p>
<p>After saving the preference information with the Web application configuration editor, you can see the added code in the <strong>Source</strong> tab:</p>
- <pre class="prettyprint">
+<pre class="prettyprint">
<preference name="key" value="value" readonly="false"/>
</pre>
<tr>
<td colspan="2"><strong>Application Control</strong></td>
<td>Describes the <a href="../../../../org.tizen.guides/html/web/app_management/app_controls_w.htm">application control functionalities</a> provided by the application. To define an application control used to access the functionality of your application, click <strong>+</strong> in the <strong>Application Control</strong> panel and define the details.
- <p>The <strong>operation</strong>, <strong>uri</strong>, and <strong>mime</strong> fields describe the functionalities that other applications can request and the <strong>src</strong> field describes the application page that handles the request.</p> <p>The following example shows the setting in the <code>config.xml</code> file code:</p> <pre class="prettyprint">
+ <p>The <strong>operation</strong>, <strong>uri</strong>, and <strong>mime</strong> fields describe the functionalities that other applications can request and the <strong>src</strong> field describes the application page that handles the request.</p> <p>The following example shows the setting in the <code>config.xml</code> file code:</p>
+<pre class="prettyprint">
<tizen:app-control>
<tizen:src name="edit.html"/>
<tizen:operation name="http://tizen.org/appcontrol/operation/edit"/>
<tizen:uri name="file"/>
<tizen:mime name="image/jpeg"/>
-</tizen:app-control></pre> </td>
+</tizen:app-control>
+</pre></td>
</tr>
<tr>
<td rowspan="6"><strong>Account</strong></td>
<td>Defines key-value pairs that can be accessed (read-only) through the Application API (in <a href="../../../../org.tizen.web.apireference/html/device_api/mobile/tizen/application.html">mobile</a> and <a href="../../../../org.tizen.web.apireference/html/device_api/wearable/tizen/application.html">wearable</a> applications).
<p>To add a key-value pair, click <strong>+</strong> in the <strong>Meta Data</strong> section, define a key (unique string) and value (string), and click <strong>OK</strong>. This attribute is optional.</p>
<p>The following example shows the setting in the <code>config.xml</code> file code:</p>
- <pre class="prettyprint">
+<pre class="prettyprint">
<tizen:metadata key="key1"/>
<tizen:metadata key="key2" value="value"/>
</pre>
<!DOCTYPE html>
<html>
<head>
- <meta charset="utf-8" />
+ <meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
<meta name="description" content="Tizen Wearable Web Basic Template"/>
<!DOCTYPE html>
<html>
<head>
- <meta charset="utf-8" />
+ <meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
<meta name="description" content="Tizen Wearable Web Basic Template"/>
<ul>
- <li>By default, the BasicWatch sample has the application category defined as <code><tizen:category name="http://tizen.org/category/wearable_clock" /></code>.
- <p>To run your application on Samsung Gear 2, Samsung Gear 2 Neo, and Samsung Gear S devices, use <code><tizen:category name="com.samsung.wmanager.WATCH_CLOCK" /></code> instead.</p>
+ <li>By default, the BasicWatch sample has the application category defined as <code><tizen:category name="http://tizen.org/category/wearable_clock"/></code>.
+ <p>To run your application on Samsung Gear 2, Samsung Gear 2 Neo, and Samsung Gear S devices, use <code><tizen:category name="com.samsung.wmanager.WATCH_CLOCK"/></code> instead.</p>
</li>
<li>
<p>To enable a custom UI for the <a href="../details/event_handling_w.htm#ambient">ambient mode</a>, the <code>ambient_support</code> attribute must be set to <code>enable</code>.</p>
<pre class="prettyprint lang-html">
<head>
- <meta charset="utf-8" />
- <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />
- <meta name="description" content="Basic Watch based on HTML canvas element" />
+ <meta charset="utf-8"/>
+ <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0"/>
+ <meta name="description" content="Basic Watch based on HTML canvas element"/>
<title>BasicWatch</title>
- <link rel="stylesheet" type="text/css" href="css/style.css" />
+ <link rel="stylesheet" type="text/css" href="css/style.css"/>
</head>
<body>
<div id="box">