</script>
<!-- tree view -->
- <title>Training</title>
+ <title>Guides</title>
</head>
<body class="no-toc" onload="prettyPrint()" style="overflow: auto;">
<li><a href="native/ui/efl/tools_n.htm" target="content">Tools</a></li>
</ul>
</li>
- <li><a href="native/ui/efl/hw_input_n.htm" target="content">Hardware Input Handling: Managing Hardware Events with EFL Extension</a>
+ <li><a href="native/ui/efl/hw_input_n.htm" target="content">Hardware Input Handling</a>
<ul>
<li><a href="native/ui/efl/key_events_mn.htm" target="content">Managing Menu and Back Key Events</a></li>
<li><a href="native/ui/efl/rotary_events_wn.htm" target="content">Managing Rotary Events</a></li>
<li><a href="native/migration_guide_n.htm" target="content">Migration Guide</a></li>
</ul>
- <div class="treeheader">
- <h2><a href="web/guides_w.htm" target="content">Web Application</a></h2>
- </div>
+<div class="treeheader">
+<h2><a href="web/guides_w.htm" target="content">Web Application</a></h2>
+</div>
- <div id="sidetreecontrol2">
+<div id="sidetreecontrol2">
<a href="?#">Collapse All</a> | <a href="?#">Expand All</a>
- </div>
+</div>
<ul id="navigation2">
<ul><li><a href="#event_and_condition">Event</a>
<p>An event literally denotes a contextual event that can be recognized by the device, or a change in a certain contextual state of the device or the user. For example, connections to peripherals, changes in settings, location changes, or specific times can be used as events. Note that only 1 event can be defined in a rule, as it is used as the initiator of the verification of the conditions. If the system detects the occurrence of the designated event, it starts to verify the conditions.</p></li>
<li><a href="#event_and_condition">Condition</a>
-<p>A condition denotes a contextual state or fact that can be recognized by the device. For example, the current device status or the historical pattern of the device usage can be used as conditions. In a rule, the application can define 1 condition, multiple conditions, or even no condition. If you define multiple conditions in a rule, the application can choose the way of combining the conditions using logical conjunctions or disjunctions. In case of the logical conjunction, the rule is true only if all the conditions are met. Otherwise, the rule can be true if at least 1 condition is met. If no condition is given, the rule is satisfied instantly when the corresponding event occurs.</p></li>
+<p>A condition denotes a contextual state or fact that can be recognized by the device. For example, the current device status or the historical pattern of the device usage can be used as conditions. In a rule, the application can define 1 condition, multiple conditions, or even no condition. If you define multiple conditions in a rule, the application can choose the way of combining the conditions using logical conjunctions or disjunctions. For a logical conjunction, the rule is true only if all the conditions are met. Otherwise, the rule can be true if at least 1 condition is met. If no condition is given, the rule is satisfied instantly when the corresponding event occurs.</p></li>
<li>Action
<p>An action is triggered when the rule is satisfied. You can set an application launch request action using an <a href="../app_management/app_controls_n.htm">application control</a>, or you can set a <a href="../notification/noti_n.htm">notification posting</a> action. For example, every day at 10:00 PM, if the battery level is low, the application can post a notification to remind the user to charge the battery.</p>
context_trigger_rule_entry_h battery_event = NULL;
context_trigger_rule_event_create(CONTEXT_TRIGGER_EVENT_BATTERY, CONTEXT_TRIGGER_LOGICAL_CONJUNCTION, &battery_event);
</pre>
-<p>While creating an event handle, the application chooses the logical operator (logical conjunction or disjunction), which is applied to combine the attribute keys for the event. In case of the <code>CONTEXT_TRIGGER_EVENT_BATTERY</code> event, 2 types of contextual states are provided: <code>CONTEXT_TRIGGER_LEVEL</code> and <code>CONTEXT_TRIGGER_IS_CHARGING</code>. Because the application wants to check both if the battery level becomes too low and if the battery is not charging, <code>CONTEXT_TRIGGER_LOGICAL_CONJUNCTION</code> must be applied.</p>
+<p>While creating an event handle, the application chooses the logical operator (logical conjunction or disjunction), which is applied to combine the attribute keys for the event. For the <code>CONTEXT_TRIGGER_EVENT_BATTERY</code> event, 2 types of contextual states are provided: <code>CONTEXT_TRIGGER_LEVEL</code> and <code>CONTEXT_TRIGGER_IS_CHARGING</code>. Because the application wants to check both if the battery level becomes too low and if the battery is not charging, <code>CONTEXT_TRIGGER_LOGICAL_CONJUNCTION</code> must be applied.</p>
</li>
<li>Add the attribute key with the <code>context_trigger_rule_entry_add_key()</code> function.
<p>The attribute key specifies the detailed comparison terms for the event.</p>
<h3 id="resolution">Determining the Application for an Implicit Launch Request</h3>
-<p>In case of an implicit launch, the platform determines which application to launch by "resolving the application control". This means that the platform considers the given conditions (operation, URI, and MIME type) in the launch request, searches the filters (installed applications with available application controls) in the device, and attempts to find a match.</p>
+<p>In the case of an implicit launch, the platform determines which application to launch by "resolving the application control". This means that the platform considers the given conditions (operation, URI, and MIME type) in the launch request, searches the filters (installed applications with available application controls) on the device, and attempts to find a match.</p>
<p>The launch request conditions are matched to the available filters using the following logic:</p>
<li><a href="app_resources_n.htm">Application Resources</a>
-<p>You can define different resources for the application to be used based on the device on which the application is run. Efficient resource management allows you to create an application that can be run on various devices with different configurations, such as different screen sizes.</p></li>
+<p>You can define different resources for the application to be used depending on the device on which the application is run. Efficient resource management allows you to create an application that can be run on various devices with different configurations, such as different screen sizes.</p></li>
<li><a href="app_preferences_n.htm">Application Preferences</a>
<li><a href="package_manager_n.htm">Package Manager</a>
-<p>You can retrieve information about the packages installed on the device. You can also monitor the changes in the device packages.</p></li>
+<p>You can retrieve information about the packages installed on the device. You can also monitor for changes in the device packages.</p></li>
<li><a href="event_n.htm">Event Broadcast and Subscription</a>
-<p>You can use events to advertise your application activities, or listen to events from other applications or the system. You can broadcast events from your application to all who want to listen. You can also subscribe to events to keep track of what is happening in the system or other applications.</p></li>
+<p>You can use events to advertise your application activities, or listen for events from other applications or the system. You can broadcast events from your application to all who want to listen. You can also subscribe to events to keep track of what is happening in the system or other applications.</p></li>
</ul>
<script type="text/javascript" src="../../scripts/jquery.zclip.min.js"></script>
<div class="note">
<strong>Note</strong>
- The file names of the resources that you want to use interchangeably based on the device conditions must be the same.
+ The file names of the resources that you want to use interchangeably depending on the device conditions must be the same.
</div>
<p align="center"></p>
</li>
<p align="center"><img src="../../images/resource_manager_emulator_running_hd.png" alt="Emulator running" /></p>
</li>
<li>In the <strong>Project Explorer</strong> view in the Tizen Studio, right-click the application and select <strong>Run As > Tizen Native Application</strong>.
-<p>The application launches on the emulator, and you can see that a different image is displayed based on the device display resolution.</p>
+<p>The application launches on the emulator, and you can see that a different image is displayed depending on the device display resolution.</p>
<p align="center"><img src="../../images/resource_manager_emulator_run_hd_us_en.png" alt="Application running on the emulator" /></p>
</li>
</ol>
</li>
-<li>If you change the emulator language settings, and run the application again, you can also see that a different image is displayed based on the device language (in this case, US English and Korean).
+<li>If you change the emulator language settings and run the application again, you can also see that a different image is displayed depending on the device language (in this case, US English and Korean).
<p align="center"><img src="../../images/resource_manager_emulator_run_us_en.png" alt="English virtual device running on the emulator" /> <img src="../../images/resource_manager_emulator_run_ko_kr.png" alt="Korean virtual device running on the emulator" /></p>
</li>
</ol>
<p align="center"><strong>Figure: UI and service application states</strong></p>
<p align="center"><img src="../../images/multiple_apps.png" alt="UI and service application life-cycle" style="display: block; text-align: center; margin-left: auto; margin-right: auto" /></p>
-<p>Because the service application has no UI, it neither has a pause state. Since Tizen 2.4, the service application can go into the suspended state. Basically, the service application is running in the background by its nature; so the platform does not allow the running of the service application unless it is designated as a background category application. However, when the UI application that is packaged with the service application is running on the foreground, the service application is also regarded as a foreground application and it can be run without a designated background category.</p>
+<p>Because a service application has no UI, neither does it have a pause state. Since Tizen 2.4, a service application can go into the suspended state. Basically, the service application is running in the background by its nature; so the platform does not allow the running of the service application unless it is designated as a background category application. However, when the UI application that is packaged with the service application is running on the foreground, the service application is also regarded as a foreground application and it can be run without a designated background category.</p>
<p>Application state changes are managed by the underlying framework. For more information on application state transitions, see <a href="efl_ui_app_n.htm#state_trans">Application States and Transitions</a>.</p>
</tr>
<tr>
<td><code>APP_CONTROL_DATA_TEXT</code></td>
- <td>The text to search. This key must be passed as a string.</td>
+ <td>The text to search for. This key must be passed as a string.</td>
<td>This key is mandatory.</td>
</tr>
</tbody>
<h4>MIME Type</h4>
<ul>
<li><code>application/vnd.tizen.calendar</code>
- <p>In case of viewing an event by an event ID, the event ID (ID in the <code>_calendar_event</code> view) extra data and <code>application/vnd.tizen.calendar</code> MIME type must be specified.</p></li>
+ <p>If viewing an event by event ID, the event ID (ID in the <code>_calendar_event</code> view) extra data and <code>application/vnd.tizen.calendar</code> MIME type must be specified.</p></li>
<li><code>text/x-vcalendar</code> (for vcalendar file)</li>
<li><code>text/vcalendar</code> (for vcalendar file)</li>
</ul>
<h4>MIME Type</h4>
<ul>
<li><code>application/vnd.tizen.contact</code>
- <p>In case of viewing a contact by a person ID, the person ID (ID in the <code>_contact_person</code> view) extra data and <code>application/vnd.tizen.contact</code> MIME type must be specified.</p>
+ <p>If viewing a contact by person ID, the person ID (ID in the <code>_contact_person</code> view) extra data and <code>application/vnd.tizen.contact</code> MIME type must be specified.</p>
</li>
<li><code>text/vcard</code></li>
<li><code>text/x-vcard</code></li>
</ul>
<h4>MIME Type</h4>
<p>Any MIME type that your application needs, such as <code>image/jpg</code>, <code>video/*</code>, or <code>*/*</code></p>
- <p>In case of sharing a single item through <code>APP_CONTROL_DATA_PATH</code> and URI specified with <code>mailto:</code>, the MIME type must be explicitly set. </p>
+ <p>If sharing a single item through <code>APP_CONTROL_DATA_PATH</code> and the URI is specified with <code>mailto:</code>, the MIME type must be explicitly set.</p>
<h4>Extra Input</h4>
<table>
<p>For example: <code>file://<media storage path>/item.jpg</code></p></li></ul>
<h4>MIME Type</h4>
<p>Any MIME type that your application needs, such as <code>image/jpg</code>, <code>video/*</code>, or <code>*/*</code></p>
- <p>In case of sharing a single item through <code>APP_CONTROL_DATA_PATH</code> and URI specified with <code>mmsto:</code>, the MIME type must be explicitly set.</p>
+ <p>If sharing a single item through <code>APP_CONTROL_DATA_PATH</code> and the URI is specified with <code>mmsto:</code>, the MIME type must be explicitly set.</p>
<h4>Extra Input</h4>
<table>
<h2 id="callback">Event Callbacks</h2>
-<p>The <code>Dali::Application</code> class emits several signals, which you can connect to.</p>
+<p>The <code>Dali::Application</code> class emits several signals which you can connect to.</p>
<p>The following table lists the callbacks for the basic signals provided by the <code>Dali::Application</code> class. These signals originally occur in the Tizen application framework, and you can use the callbacks to react to them.</p>
</tr>
<tr>
<td><code>GetHour24()</code></td>
- <td>Get the hour from the <code>WatchTime</code> handle in the 24-hour format.</td>
+ <td>Get the hour from the <code>WatchTime</code> handle in 24-hour format.</td>
</tr>
<tr>
<td><code>GetMinute()</code></td>
<h2 id="callback">Event Callbacks</h2>
-<p>The <code>Dali::WatchApplication</code> class emits several signals, which you can connect to.</p>
+<p>The <code>Dali::WatchApplication</code> class emits several signals which you can connect to.</p>
<p>The following table lists the callbacks for the watch application signals provided by the <code>Dali::WatchApplication</code> class. These signals originally occur in the Tizen application framework, and you can use the callbacks to react to them.</p>
<li>Data ID
<ul>
<li>It is used for identifying data (usually a database table name or a registry section name) exported by the data control provider.</li>
- <li>It must be unique in the data control provider and it is given as a string of one or more components, separated by a slash ("/") character.</li>
+ <li>It must be unique in the data control provider and it is given as a string of 1 or more components, separated by a slash ("/") character.</li>
</ul>
</li>
<li>Type
<p>You can use the Enlightenment Foundation Libraries (EFL) to create a 2D-based Tizen native application. However, EFL supports 2.5D and 3D effects and 3D objects as well. For 3D-based Tizen native applications, you can use the <a href="../ui/dali/dali_n.htm">Dynamic Animation Library (DALi) UI toolkit</a> as well.</p>
-<p>EFL is a collection of libraries that are independent or can build on top of each-other. They provide useful features that complement an OS's existing environment, rather than wrap and abstract it, trying to be their own environment and OS in its entirety. This means that EFL expects you to use other system libraries and APIs in conjunction with EFL libraries to provide a whole working application or library - simply using EFL as a set of convenient pre-made libraries to accomplish a whole host of complex or painful tasks for you.</p>
+<p>EFL is a collection of libraries that are independent or can build on top of each other. It provides useful features that complement an existing OS environment, rather than wrapping or abstracting it. This means that EFL expects you to use other system libraries and APIs in conjunction with EFL libraries to provide a complete working application or library - using EFL as a set of convenient pre-made libraries to accomplish a whole host of complex or tedious tasks.</p>
<h2 id="basic" name="basic">Basic Fundamentals</h2>
<p>To create an EFL basic UI application, you must:</p>
<ul>
- <li>Define the <a href="#fundamentals">the application fundamentals</a>, mainly the entry point and life-cycle callbacks.
+ <li>Define the <a href="#fundamentals">application fundamentals</a>, mainly the entry point and life-cycle callbacks.
<p>The entry point starts the event loop, which is mandatory for every Tizen native application. Within the event loop, the application can receive both basic system events and application state change events. You can register <a href="#callback">callbacks for these events</a> to react to them.</p></li>
<li>Manage <a href="#state_trans">application states and transitions</a> during its life-cycle.</li>
<li>Define a <a href="#allow_bg">background category</a> for your application, if you want it to run in the background.</li>
<p>For more information, see <a href="#state_trans">Application State and Transition Management</a>.</p>
-<p>To listen to system events, use the <code>ui_app_add_event_handler()</code> function. The system events are triggered with the <code>app_event_cb()</code> callback function. The following table lists the event types.</p>
+<p>To listen for system events, use the <code>ui_app_add_event_handler()</code> function. The system events are triggered with the <code>app_event_cb()</code> callback function. The following table lists the event types.</p>
<p align="center" class="Table"><strong>Table: Event types</strong></p>
<table>
<td><code>N/A</code></td>
<td><code>N/A</code>
</td>
- <td>When platform booting has been completed.
+ <td>When the platform has completed booting.
</td>
<td>You can treat the initial value as <code>false</code> before you receive this event. If the application is already in a boot-completed state before you register an event handler, you receive the event as soon as you register the event handler.</td>
</tr>
</ul>
<div class="note">
<strong>Note</strong>
- Above numbers can differ according to the total RAM size of the target device.
+ The above numbers can vary depending on the total RAM size of the target device.
</div>
</td>
<td>
<tr>
<td><code>tizen.system.event.language_set</code></td>
<td><code>language_set</code></td>
- <td>The value of this key is full name of locale, for example, <code>ko_KR.UTF8</code> in case of Korean and <code>en_US.UTF8</code> in case of American English. For more information, see the Linux locale information.
+ <td>The value of this key is the full name of the locale, for example, <code>ko_KR.UTF8</code> for Korean and <code>en_US.UTF8</code> for American English. For more information, see the Linux locale information.
</td>
<td>
When the <code>language_set</code> has changed.
<tr>
<td><code>tizen.system.event.region_format</code></td>
<td><code>region_format</code></td>
- <td>The value of this key is the full name of the locale, for example, <code>ko_KR.UTF8</code> in case of the Korean region format and <code>en_US.UTF8</code> in case of the USA region format. For more information, see the Linux locale information.
+ <td>The value of this key is the full name of the locale, for example, <code>ko_KR.UTF8</code> for the Korean region format and <code>en_US.UTF8</code> for the USA region format. For more information, see the Linux locale information.
</td>
<td>
When the region format has changed.
<p>The main Service Application API features include:</p>
<ul>
<li>Application states
- <p>A Tizen native service application has several different <a href="#states">states, which it transitions through</a> during its life-cycle.</p></li>
+ <p>A Tizen native service application has several different <a href="#states">states which it transitions through</a> during its life-cycle.</p></li>
<li>Event callbacks
<p>The service application can receive both basic system events and application state change events. You can register <a href="#register">callbacks for these events</a> to react to them.</p></li>
<li>Application behavior attributes
- <p>You can <a href="#attribute">determine your application behavior</a> at boot time and after abnormal terminations by using specific attributes, which you can set in the application manifest file.</p></li>
+ <p>You can <a href="#attribute">determine your application behavior</a> at boot time and after abnormal terminations by using specific attributes which you can set in the application manifest file.</p></li>
</ul>
<p>Service applications can be explicitly launched by a UI application. They can also be launched conditionally.</p>
</tbody>
</table>
-<p>Because the service application has no UI, it neither has a pause state. Since Tizen 2.4, the service application can go into the suspended state. Basically, the service application is running in the background by its nature; so the platform does not allow the running of the service application unless it is designated as a background category application. However, when the UI application that is packaged with the service application is running on the foreground, the service application is also regarded as a foreground application and it can be run without a designated background category. For more information on using and defining a background category, see <a href="efl_ui_app_n.htm#allow_bg">Background Categories</a>.</p>
+<p>Because a service application has no UI, neither does it have a pause state. Since Tizen 2.4, the service application can go into the suspended state. Basically, the service application is running in the background by its nature; so the platform does not allow the running of the service application unless it is designated as a background category application. However, when the UI application that is packaged with the service application is running on the foreground, the service application is also regarded as a foreground application and it can be run without a designated background category. For more information on using and defining a background category, see <a href="efl_ui_app_n.htm#allow_bg">Background Categories</a>.</p>
<h2 id="register" name="register">Event Callbacks</h2>
<p>Pay specific attention to the following attributes:</p>
<ul><li><code>auto-restart</code>
-<p>If set to <code>true</code>, the application restarts whenever it terminates abnormally. If the application is running, it is launched after installing or upgrading the package.</p>
+<p>If set to <code>true</code>, the application restarts whenever it terminates abnormally. If the application is running, it is launched after installing or updating the package.</p>
<div class="note">
<strong>Note</strong>
</div>
</li>
<li><code>on-boot</code>
-<p>If set to <code>true</code>, the application launches on boot time, and after installing or upgrading the package. The application does not start if this attribute is removed after updating the package.</p>
+<p>If set to <code>true</code>, the application launches on boot time, and after installing or updating the package. The application does not start if this attribute is removed after updating the package.</p>
<div class="note">
<strong>Note</strong>
<ul>
<li>EFL
- <p>The EFL application is based on the Enlightenment Foundation Library. The EFL application provides a 2D-based Tizen native application, and streamlined graphic core libraries you need to create powerful applications. EFL needs relatively low memory but provides high performance, and supports a retained mode graphics system and user-centric features, such as themes, 2D/3D effects, and accessibility. In addition, EFL supports various resolutions with the same layout, fast and small file systems, a variety of programming language bindings, and a separate UI and logic.</p>
+ <p>The EFL application is based on the Enlightenment Foundation Library. With EFL and streamlined graphic core libraries, you can create powerful 2D-based Tizen native applications. EFL needs relatively low memory but provides high performance, and supports a retained mode graphics system and user-centric features, such as themes, 2D/3D effects, and accessibility. In addition, EFL supports various resolutions with the same layout, fast and small file systems, a variety of programming language bindings, and a separate UI and logic.</p>
<p>For more information on the available application types with EFL, see <a href="efl_app_n.htm">EFL Applications</a>.</p>
</li>
<ol>
<li>Define the ambient mode callbacks.
<ul><li><p>The <code>ambient_changed</code> event is triggered when the ambient mode is enabled or disabled on the device. You can use the callback to initialize your ambient mode UI.</p></li>
-<li><p>The <code>ambient_tick</code> event is triggered every minute while the device is in the ambient mode. You can use the callback to update the time on your watch application in the ambient mode. In this callback, do not perform time-consuming task and always update the UI as fast as possible. The platform can put the device to sleep shortly after the ambient tick expires.</p></li></ul>
+<li><p>The <code>ambient_tick</code> event is triggered every minute while the device is in the ambient mode. You can use the callback to update the time on your watch application in the ambient mode. In this callback, do not perform time-consuming task and always update the UI as quickly as possible. The platform can put the device to sleep shortly after the ambient tick expires.</p></li></ul>
<pre class="prettyprint">
void
app_ambient_tick(watch_time_h watch_time, void* user_data)
<h2 id="share" name="share">Data Sharing Between the Widget Application and Other Applications</h2>
-<p>You can share data between widget applications and UI (or service) applications. However, you must understand that this kind of data sharing is based on the file system. The reason is that the system (Home screen) controls the widget application life-cycle, while the UI application life-cycle is mostly explicitly controlled by the user.</p>
+<p>You can share data between widget applications and UI (or service) applications. However, you must understand that this kind of data sharing is dependent on the file system. The reason is that the system (Home screen) controls the widget application life-cycle, while the UI application life-cycle is mostly explicitly controlled by the user.</p>
<p>For example, consider the differences between a Weather application and a Weather widget:</p>
<ul>
<li><a href="https://developer.tizen.org/development/sample/native/Network/Bluetooth_Chat_1" target="_blank">Bluetooth Chat (Mobile) Sample Description</a></li>
<li><a href="https://developer.tizen.org/development/sample/native/Network/Bluetooth_Chat" target="_blank">Bluetooth Chat (Wearable) Sample Description</a></li>
<li><a href="https://developer.tizen.org/development/sample/native/Network/Bluetooth_LE_Service" target="_blank">Bluetooth LE Service Sample Description</a></li>
- </ul>
+ </ul>
</div></div>
</div>
<p>The Bluetooth Device API (in <a href="../../../../org.tizen.native.mobile.apireference/group__CAPI__NETWORK__BLUETOOTH__DEVICE__MODULE.html">mobile</a> and <a href="../../../../org.tizen.native.wearable.apireference/group__CAPI__NETWORK__BLUETOOTH__DEVICE__MODULE.html">wearable</a> applications) provides functions for managing bonds with other devices and searching for supported services. The API is used to handle the connection with other devices and to search for services available on remote devices.</p>
<p>You can <a href="#find">discover other Bluetooth devices</a>. The device discovery process can retrieve multiple types of Bluetooth devices, such as printers, mobile phones, and headphones.</p>
</li>
- <li>Creating a bonding with a Bluetooth device
- <p>You can create a bonding with another device with the Bluetooth Device API. The bonding allows the 2 devices to establish a connection.</p>
+ <li>Creating a bond with a Bluetooth device
+ <p>You can create a bond with another device with the Bluetooth Device API. Bonding allows the 2 devices to establish a connection.</p>
<p>Connected devices exchange keys needed for encrypted communication, but each connection has to be approved by the latest application user. You can also set authorization of other devices. Authorized devices are connected automatically without the latest user being asked for authorization.</p>
</li>
<li>Connecting to and exchanging data with a Bluetooth device using a Bluetooth socket
<li>Define and register the discovery state change callback.
<p>Register the callback with the <code>bt_adapter_set_device_discovery_state_changed_cb()</code> (classic Bluetooth) or <code>bt_adapter_le_set_device_discovery_state_changed_cb()</code> (Bluetooth LE) function.</p>
<p>Use the callback to manage the discovery process:</p>
-<ul><li><p>The first callback parameter defines the result of the Bluetooth discovery process. In case of success, the parameter value is <code>BT_ERROR_NONE</code>. If the discovery failed to start due to an error, the parameter value is <code>BT_ERROR_TIMEOUT</code>.</p></li>
+<ul><li><p>The first callback parameter defines the result of the Bluetooth discovery process. If successful, the parameter value is <code>BT_ERROR_NONE</code>. If the discovery failed to start due to an error, the parameter value is <code>BT_ERROR_TIMEOUT</code>.</p></li>
<li><p>The second callback parameter defined the current state of the discovery process using the enumerators <code>bt_adapter_device_discovery_state_e</code> (classic Bluetooth) (in <a href="../../../../org.tizen.native.mobile.apireference/group__CAPI__NETWORK__BLUETOOTH__ADAPTER__MODULE.html#gaae6b21353576e515e5bb1e76d25472bd">mobile</a> and <a href="../../../../org.tizen.native.wearable.apireference/group__CAPI__NETWORK__BLUETOOTH__ADAPTER__MODULE.html#gaae6b21353576e515e5bb1e76d25472bd">wearable</a> applications) or <code>bt_adapter_le_device_discovery_state_e</code> (Bluetooth LE) (in <a href="../../../../org.tizen.native.mobile.apireference/group__CAPI__NETWORK__BLUETOOTH__ADAPTER__LE__MODULE.html#ga4b90a954c6cfb51b60d520c114d8f62d">mobile</a> applications):</p>
<ul><li>When you start the discovery process, the callback is triggered with the <code>BT_ADAPTER_DEVICE_DISCOVERY_STARTED</code> or <code>BT_ADAPTER_LE_DEVICE_DISCOVERY_STARTED</code> state.
<p>Similarly, when you stop the discovery process, the callback is triggered with the <code>BT_ADAPTER_DEVICE_DISCOVERY_FINISHED</code> or <code>BT_ADAPTER_LE_DEVICE_DISCOVERY_FINISHED</code> state.</p></li>
<p>To stop the device discovery, call the <code>bt_adapter_stop_device_discovery()</code> (classic Bluetooth) or <code>bt_adapter_le_stop_device_discovery()</code> (Bluetooth LE) function.</p>
</li>
<li>
-<p>To bond with a discovered remote device, use the <code>bt_device_create_bond()</code> function. To cancel the bonding, call the <code>bt_device_cancel_bonding()</code> function.</p>
+<p>To bond with a discovered remote device, use the <code>bt_device_create_bond()</code> function. To cancel bonding, call the <code>bt_device_cancel_bonding()</code> function.</p>
<pre class="prettyprint">
ret = bt_device_create_bond(bt_server_address);
}
</pre>
-<p>After you have successfully bonded with a remote device, it is included in the bonded device list. When you want to connect to that device again in the future, you do not need to discover it again. Instead, you can simply query the bonded device list to receive the information (such as address and name) you need to connect to the device. You can also query the bonded device list to verify that the bonding was successful.</p>
+<p>After you have successfully bonded with a remote device, it is included in the bonded device list. When you want to connect to that device again in the future, you do not need to discover it again. Instead, you can simply query the bonded device list to receive the information (such as address and name) you need to connect to the device. You can also query the bonded device list to verify that bonding was successful.</p>
</li>
</ol>
</li>
<div class="note">
<strong>Note</strong>
To handle HTTP and HTTPS requests in a proxy environment, <a href="#detail">get the proxy address</a> using the Connection Manager and then set the proxy address using the Connection Profile API (in <a href="../../../../org.tizen.native.mobile.apireference/group__CAPI__NETWORK__CONNECTION__PROFILE__MODULE.html">mobile</a> and <a href="../../../../org.tizen.native.wearable.apireference/group__CAPI__NETWORK__CONNECTION__PROFILE__MODULE.html">wearable</a> applications).
- <p>In case of libcurl, you can <a href="curl_n.htm#manage">use the <code>CURLOPT_PROXY</code> option</a>.</p>
+ <p>For libcurl, you can <a href="curl_n.htm#manage">use the <code>CURLOPT_PROXY</code> option</a>.</p>
</div>
<div id="container"><div id="contents"><div class="content">
<h1>Download</h1>
- <p>You can create and manage one or more download requests at a time. Each download process goes through a <a href="#state">set of states</a>, and you can manage the process though the states with specific functions.</p>
+ <p>You can create and manage 1 or more download requests at a time. Each download process goes through a <a href="#state">set of states</a>, and you can manage the process though the states with specific functions.</p>
<p>This feature is supported in mobile applications only.</p>
<ul>
<li>HTTP session
-<p>A session is a set of one or more transactions. You must <a href="#session">create an HTTP session</a> before you can create transactions.</p>
+<p>A session is a set of 1 or more transactions. You must <a href="#session">create an HTTP session</a> before you can create transactions.</p>
</li>
<li>HTTP transaction
<p>A transaction represents a single operation between a client and a server (a single request to the Web server). To <a href="#transaction">request for a resource from a Web server</a>, create a transaction handle and open an HTTP transaction from the HTTP session.</p>
<li><a href="download_n.htm">Download</a> <strong>in mobile applications only</strong>
-<p>You can download files from the Internet by creating a download process, configuring the download URL or destination, and launching the process. You can manager and monitor one or more downloads at the same time.</p></li>
+<p>You can download files from the Internet by creating a download process, configuring the download URL or destination, and launching the process. You can manage and monitor 1 or more downloads at the same time.</p></li>
<li><a href="curl_n.htm">Curl</a>
</pre>
</li>
<li>Register the resource by calling the <code>iotcon_resource_create()</code> function.
-<p>In the function, set the URI path, resource types, interfaces (<code>iotcon_resource_interfaces_h</code> resource interface handle in <a href="../../../../org.tizen.native.mobile.apireference/group__CAPI__IOT__CONNECTIVITY__COMMON__MODULE.html#ga10fbc5191f6d83eaedbcbdeb3e1211a8">mobile</a> and <a href="../../../../org.tizen.native.wearable.apireference/group__CAPI__IOT__CONNECTIVITY__COMMON__MODULE.html#ga10fbc5191f6d83eaedbcbdeb3e1211a8">wearable</a> applications), policies (one or more <code>iotcon_resource_policy_e</code> enumeration values in <a href="../../../../org.tizen.native.mobile.apireference/group__CAPI__IOT__CONNECTIVITY__COMMON__MODULE.html#ga66063156ce698fa862cb9704be86494f">mobile</a> and <a href="../../../../org.tizen.native.wearable.apireference/group__CAPI__IOT__CONNECTIVITY__COMMON__MODULE.html#ga66063156ce698fa862cb9704be86494f">wearable</a> applications), and the request handler callback function called when a request arrives from a client.</p>
+<p>In the function, set the URI path, resource types, interfaces (<code>iotcon_resource_interfaces_h</code> resource interface handle in <a href="../../../../org.tizen.native.mobile.apireference/group__CAPI__IOT__CONNECTIVITY__COMMON__MODULE.html#ga10fbc5191f6d83eaedbcbdeb3e1211a8">mobile</a> and <a href="../../../../org.tizen.native.wearable.apireference/group__CAPI__IOT__CONNECTIVITY__COMMON__MODULE.html#ga10fbc5191f6d83eaedbcbdeb3e1211a8">wearable</a> applications), policies (1 or more <code>iotcon_resource_policy_e</code> enumeration values in <a href="../../../../org.tizen.native.mobile.apireference/group__CAPI__IOT__CONNECTIVITY__COMMON__MODULE.html#ga66063156ce698fa862cb9704be86494f">mobile</a> and <a href="../../../../org.tizen.native.wearable.apireference/group__CAPI__IOT__CONNECTIVITY__COMMON__MODULE.html#ga66063156ce698fa862cb9704be86494f">wearable</a> applications), and the request handler callback function called when a request arrives from a client.</p>
<p>The URI path must be unique. The <code>iotcon_resource_create()</code> function fails, if you use an existing URI to register another resource.</p>
<pre class="prettyprint">
<ul>
<li>MTP device is a device that supports MTP. It has an MTP responder role and 1 or more MTP storages.</li>
-<li>MTP storage is the storage on the MTP device. It has zero or more MTP objects.</li>
+<li>MTP storage is the storage on the MTP device. It has 0 or more MTP objects.</li>
<li>MTP object is the actual file. Each file on the device has a unique handle called "object handle". (The handle is not unique in each storage.)
<p>The MTP object has a parent object, so it can indicate a file hierarchy. If the parent object is 0, the object is in the root of the storage.</p></li>
</ul>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
</div>
</li>
<li>Host-based card emulation (HCE)
-<p>HCE is on-device technology that permits a phone to perform card emulation on an NFC-enabled device without relying on access to a secure element (SE). The data is routed to the user space on which Tizen applications reside, instead of routing the data to a secure element.</p>
+<p>HCE is an on-device technology that permits a phone to perform card emulation on an NFC-enabled device without relying on access to a secure element (SE). The data is routed to the user space on which Tizen applications reside, instead of routing the data to a secure element.</p>
<p align="center"><strong>Figure: Card emulation with HCE</strong></p>
<p align="center"> <img alt="Card emulation with HCE" src="../../images/nfc_card_emulation_hce.png" /> </p>
<p>HCE allows you to create your own card emulation system and bypass the SE. This approach brings 2 advantages:</p>
<ul>
-<li>In case of UICC type SE, the mobile service provider is involved in the card emulation behavior. With HCE, you are free from the provider influence.</li>
+<li>For UICC-type SE, the mobile service provider is involved in the card emulation behavior. With HCE, you are independent of the service provider.</li>
<li>You do not need SE hardware chips within the device.</li></ul>
<p>To understand HCE behavior, mainly how data is internally routed to the correct application, consider how Tizen handles NFC routing:</p>
}
</pre>
-<p>The <code>gmainloop</code>, which is being created here, is used to wait for the results of calling asynchronous functions.</p></li>
+<p>The <code>gmainloop</code> created here is used to wait for the results of calling asynchronous functions.</p></li>
<li>
<p>To initialize NFC, call the <code>nfc_manager_initialize()</code> function to start the initialization:</p>
<pre class="prettyprint">
</pre></li></ul>
</li>
<li>
-<p>To get more information from the tag, specify what type of a tag message you are dealing with:</p>
+<p>To get more information from the tag, specify what type of tag message you are dealing with:</p>
<ul>
<li>If there is a message with <code>Type = "T"</code> and the TNF is <code>NFC_RECORD_TNF_WELL_KNOWN</code>, it is possible to get the following data:
<pre class="prettyprint">
</pre>
</li>
<li>
-<p>If the TNF of the record is <code>NFC_RECORD_TNF_MIME_MEDIA</code>, it is possible to get the record mime type:</p>
+<p>If the TNF of the record is <code>NFC_RECORD_TNF_MIME_MEDIA</code>, it is possible to get the record MIME type:</p>
<pre class="prettyprint">
error_code = nfc_ndef_record_get_mime_type(record, &mime);
if (NFC_ERROR_NONE != error_code)
/* Error occurred */
</pre>
-<p>Use the callback to read the received message. You can check its number of records using the <code>nfc_ndef_message_get_record_count()</code> function and get more detailed info about the message itself by calling the <code>nfc_ndef_message_read_cb()</code> function, similarly as with the NFC tag messages described earlier.</p>
+<p>Use the callback to read the received message. You can check its number of records using the <code>nfc_ndef_message_get_record_count()</code> function and get more detailed information about the message itself by calling the <code>nfc_ndef_message_read_cb()</code> function, similarly as with the NFC tag messages described earlier.</p>
<pre class="prettyprint">
static void
on_nfc_p2p_read_completed(nfc_p2p_target_h target, nfc_ndef_message_h message,
if (NFC_ERROR_NONE != error_code)
/* Error occurred */
</pre>
-<p>After getting the message, get the detailed information from the message as described in <a href="#work">Working with NFC Connections and Messages</a>. First check whether there are any errors and that the message is not <code>NULL</code>:</p>
+<p>After getting the message, get the detailed information from the message as described in <a href="#work">Working with NFC Connections and Messages</a>. First, check whether there are any errors and that the message is not <code>NULL</code>:</p>
<pre class="prettyprint">
if (message != NULL)
on_nfc_ndef_discovered(clone_message(message), NULL);
</application>
</pre>
<ul><li>The <code>application</code> element must contain a <code>name</code> attribute with an application name.</li>
-<li>The <code>application</code> element must contain one or more <code>wallet</code> element, each of which must contain one or more <code>aid-group</code> element. </li>
+<li>The <code>application</code> element must contain 1 or more <code>wallet</code> elements, each of which must contain 1 or more <code>aid-group</code> elements.</li>
<li>The <code>aid-group</code> element is required to contain a <code>category</code> attribute with the <code>payment</code> or <code>other</code> value.</li>
-<li>Each <code>aid-group</code> element must contain one or more <code>aid</code> element, each of which contains a single AID. The <code>aid-group</code> can have as many <code>aid</code> elements as you want.</li>
+<li>Each <code>aid-group</code> element must contain 1 or more <code>aid</code> elements, each of which contains a single AID. The <code>aid-group</code> can have as many <code>aid</code> elements as you want.</li>
<li>The <code>aid</code> element must contain the <code>aid</code>, <code>se_type</code>, <code>unlock</code>, and <code>power</code> attributes.</li>
<li>The <code>se_type</code> attribute must contain <code>hce</code>, <code>ese</code>, or <code>uicc</code>. The <code>se_type</code> value can be added later.</li>
<li>The <code>unlock</code> attribute must contain one of the following:
</li>
<li>
<p>Get the telephony handle with the <code>telephony_init()</code> function. Pass the <code>telephony_handle_list_s</code> structure pointer as a parameter to get the telephony handles for all subscriptions.</p>
-<p>In a multi-SIM scenario, you must define which subscription (SIM1 or SIM2) you need, in case the application is related to calling, networks, modems, or SIM cards. The telephony feature provides a function to create handles for different subscriptions. For example, there are 2 handles in a dual SIM device. In this case, <code>handle[0]</code> means the primary SIM and <code>handle[1]</code> means the secondary SIM. You can send requests to specific subscriptions using the telephony handle for that subscription.</p>
+<p>In a multi-SIM scenario, you must define which subscription (SIM1 or SIM2) you need, if your application is related to calling, networks, modems, or SIM cards. The telephony feature provides a function to create handles for different subscriptions. For example, there are 2 handles for a dual SIM device. In this case, <code>handle[0]</code> means the primary SIM and <code>handle[1]</code> means the secondary SIM. You can send requests to specific subscriptions using the telephony handle for that subscription.</p>
<pre class="prettyprint">
telephony_handle_list_s handle_list;
<th>API</th>
</tr>
<tr>
- <td>Alt+Left</td>
+ <td>Alt + Left</td>
<td>Go to the previous view in the browsing history.</td>
<td><code>ewk_view_back()</code></td>
</tr>
<tr>
- <td>Alt+Right</td>
+ <td>Alt + Right</td>
<td>Go to the next view in the browsing history.</td>
<td><code>ewk_view_forward()</code></td>
</tr>
<td><code>ewk_view_reload()</code></td>
</tr>
<tr>
- <td>Alt+F5</td>
+ <td>Alt + F5</td>
<td>Reload the view bypassing the cache.</td>
<td><code>ewk_view_bypass_cache()</code></td>
</tr>
<h2 id="space" name="space">Retrieving Storage Space Information</h2>
-<p>To get the available and total space size of the storage, use the <code>storage_get_total_space()</code> and <code>storage_get_available_space()</code> functions. They return the storage size, excluding the minimum memory size to launch the low memory pop-up in case of a low memory situation. Consequently, the available size must be less than the original available size, and you must use these functions to get the memory size. For the same reason, you cannot use the <code>statvfs</code> function directly in Tizen. Instead, use <code>storage_get_internal_memory_size()</code> and <code>storage_get_external_memory_size()</code>. The Statvfs structure has a different structure size defined by "__USE_FILE_OFFSET64". However, you can ignore this, since the Storage API uses a proper function automatically.</p>
+<p>To get the available and total size of the storage, use the <code>storage_get_total_space()</code> and <code>storage_get_available_space()</code> functions. They return the storage size, excluding the minimum memory size to launch the low memory pop-up in a low memory situation. Consequently, the available size must be less than the original available size, and you must use these functions to get the memory size. For the same reason, you cannot use the <code>statvfs</code> function directly in Tizen. Instead, use <code>storage_get_internal_memory_size()</code> and <code>storage_get_external_memory_size()</code>. The Statvfs structure has a different structure size defined by "__USE_FILE_OFFSET64". However, you can ignore this, since the Storage API uses a proper function automatically.</p>
<p>To retrieve storage space information:</p>
<ul>
</li>
</ol></li>
-<li><p>To operate with OpenSSL AES, salt and initial vectors are needed. Those are auxiliary variables, which are used to generate a cryptographic key:</p>
+<li><p>To operate with OpenSSL AES, salt and initial vectors are needed. Those are auxiliary variables which are used to generate a cryptographic key:</p>
<ul>
<li><code>RAND_bytes()</code> generates a random chain of bytes.</li>
<li>An additional character is appended after the last character of a chain to point the end of the salt[8]=0x00 variable.</li>
<p>Use the <code>DecryptRecords()</code> function to select all encrypted records from the database, and decrypt and list them:</p>
<ul>
<li>Use the <code>SELECT * FROM EncryptedData</code> query where <code>ENCRYPTED='1'</code> query to retrieve all encrypted records.</li>
-<li>The <code>callbackdecrypt()</code> callback is invoked for each found record. In case of an error, the SQLite API requires you to release the error message memory with the <code>sqlite3_free()</code> function.</li>
+<li>The <code>callbackdecrypt()</code> callback is invoked for each found record. If there is an error, the SQLite API requires you to release the error message memory with the <code>sqlite3_free()</code> function.</li>
<li>The callback is similar to the earlier callback used to list the database content.
<p>There is an action added for the <code>argv[ i ] && i == 0</code> case, which includes the encrypted content in columns that are not empty and are DATA.</p>
<p>To decrypt the message, decode the data from Base 64, add a delimiting character, perform the actual decryption with the <code>DecryptMsg()</code> function, and list the decrypted data.</p></li>
<td>Indicates whether the packet data through 3G network is enabled.</td>
</tr>
<tr>
- <td><code>RUNTIME_INFO_KEY_DATA_ROAMING_ENABLE</code></td>
+ <td><code>RUNTIME_INFO_KEY_DATA_ROAMING_ENABLED</code></td>
<td><code>bool</code></td>
<td>Indicates whether data roaming is enabled.</td>
</tr>
<div class="note">
<strong>Note</strong>
- Some device-specific information keys look similar to feature keys for application filtering, but their usage differs. Feature keys for device-specific information are used to determine whether the feature is supported in the system. Feature keys for application filtering let the Tizen store filter applications based on features.
+ Some device-specific information keys look similar to feature keys for application filtering, but their usage differs. Feature keys for device-specific information are used to determine whether the feature is supported in the system. Feature keys for application filtering let the Tizen Store filter applications based on features.
</div>
<li>Obtaining a message for specific error code
<p>Use the <code>get_error_message()</code> function to query the meaning of each error code.
-The pointer returned is a static variable, you must not free it.</p>
+The pointer returned is a static variable; you must not free it.</p>
<p>For example:</p>
<pre class="prettyprint">
<li>In the dlog utility (when testing with a target device), <a href="#dlogutil">use the device sdb shell with logutil commands</a>.
<p>You can use the message priority and tag to filter the output and only view specific messages.</p></li>
<li>In the Tizen Studio (when testing with an emulator), use the <strong>Log</strong> view.
-<p>You can filter the messages based on their priority level. You can also search the messages based on keywords, such as pid, tid, tag, and message.</p>
+<p>You can filter the messages by their priority level. You can also search the messages by keywords, such as pid, tid, tag, and message.</p>
<p align="center"><strong>Figure: Messages in the Log view</strong></p>
<p align="center"><img alt="Messages in the Log view" src="../../images/debugging.png"/></p></li>
</ul>
<h2 id="check" name="check">Checking the Output Logs</h2>
-<p>To check the content of the output log, execute dlogutil on the device sdb shell. The following code snippet shows examples of the various available commands and their output.</p>
+<p>To check the content of the output log, execute dlogutil in the device sdb shell. The following code snippet shows examples of the various available commands and their output.</p>
<p>For information on connecting to the target and using it with SDB, see <a href="../../../../org.tizen.studio/html/common_tools/smart_development_bridge.htm">Connecting Devices over Smart Development Bridge</a>.</p>
<pre class="prettyprint">
<li><a href="https://developer.tizen.org/development/sample/native/Graphics/Cairo_Image_Paint" target="_blank">Cairo Image Paint Sample Description</a></li>\r
<li><a href="https://developer.tizen.org/development/sample/native/Graphics/Cairo_Show_Text" target="_blank">Cairo Show Text Sample Description</a></li>\r
<li><a href="https://developer.tizen.org/development/sample/native/Graphics/Cairo_Touch_Drawing" target="_blank">Cairo Touch Drawing Sample Description</a></li>\r
- </ul>\r
+ </ul>\r
</div></div>\r
</div>\r
\r
\r
<h3>Creating a Cairo Image Surface in the Evas GL Backend</h3>\r
\r
-<p>To develop an application with Elementary, you create a window by using the elementary utility function, <code>elm_win_util_standard_add()</code>. And, in order to make the GL application use the GPU, you must call the <code>elm_config_accel_preference_set()</code> function before creating the window. You also place an <code>Evas_Object</code> image into your application's main window. For more information on creating and placing an <code>Evas_Object</code> image, see <a href="../ui/efl/evas_basic_objects_n.htm">Manipulating Graphical Objects</a>.</p>\r
+<p>To develop an application with Elementary, you create a window by using the Elementary utility function, <code>elm_win_util_standard_add()</code>. In order to make the GL application use the GPU, you must call the <code>elm_config_accel_preference_set()</code> function before creating the window. You also place an <code>Evas_Object</code> image into your application's main window. For more information on creating and placing an <code>Evas_Object</code> image, see <a href="../ui/efl/evas_basic_objects_n.htm">Manipulating Graphical Objects</a>.</p>\r
\r
<p>In the Cairo Image backend, you can create a new Cairo image surface by using the <code>cairo_image_surface_create()</code> or <code>cairo_image_surface_create_for_data()</code> function. The former function requires only the pixel format and dimensions to be specified, while the latter function requires additional data, such as a pointer to an image buffer (supplied by the application) in which to write the content. In order to display a result of Cairo rendering, you must also link an Evas image object to the created Cairo image surface. For this purpose, use the <code>evas_object_image_data_set()</code> function.</p>\r
\r
\r
<h3>Drawing a Line</h3>\r
\r
-<p>When drawing an image with Cairo, you must prepare the context (nouns) for each of the drawing verbs. For example, if you want to use the <code>cairo_stroke()</code> or <code>cairo_fill()</code> function, create a path first. Similarly, in case of using the <code>cairo_show_text()</code> function, you must position your text by its insertion point. A primary source is needed for using the <code>cairo_paint()</code> function and a second source pattern or surface is prepared for using the <code>cairo_mask()</code> function. For more information, see the <a href="http://www.cairographics.org/tutorial/" target="_blank">Cairo Tutorial in cairographics.org</a>.</p>\r
+<p>When drawing an image with Cairo, you must prepare the context (nouns) for each of the drawing verbs. For example, if you want to use the <code>cairo_stroke()</code> or <code>cairo_fill()</code> function, create a path first. Similarly, when using the <code>cairo_show_text()</code> function, you must position your text by its insertion point. A primary source is needed for using the <code>cairo_paint()</code> function and a second source pattern or surface is prepared for using the <code>cairo_mask()</code> function. For more information, see the <a href="http://www.cairographics.org/tutorial/" target="_blank">Cairo Tutorial in cairographics.org</a>.</p>\r
\r
<p>The following example creates a line drawing with a rectangle, and a path that uses straight sections, arcs, and Bézier curves.</p>\r
\r
</li>\r
\r
<li>To add a line segment on the path from the current point to the beginning of the current sub-path, use the <code>cairo_close_path()</code> function. After this call, the current point is repositioned at the joined endpoint of the sub-path.\r
-<p>The behavior of the <code>cairo_close_path()</code> function differs from the <code>cairo_line_to()</code> function with the equivalent coordinates very little: in the case of stroking, a line joining the final and initial segments of the sub-path is also created.</p>\r
+<p>The behavior of the <code>cairo_close_path()</code> function differs from the <code>cairo_line_to()</code> function with the equivalent coordinates very little: for stroking, a line joining the final and initial segments of the sub-path is also created.</p>\r
\r
<pre class="prettyprint">\r
cairo_close_path(cairo);\r
</pre>\r
</li>\r
\r
-<li>If you need to create a stroke on a path, the <code>cairo_stroke()</code> function is a drawing operator that draws a stroke on the current path in accordance to the current line width and line color. After the function call, the current path is cleared from the Cairo context.\r
+<li>If you need to create a stroke on a path, the <code>cairo_stroke()</code> function is a drawing operator that draws a stroke on the current path, using the current line width and line color. After the function call, the current path is cleared from the Cairo context.\r
\r
<pre class="prettyprint">\r
cairo_stroke(cairo);\r
<h1>Creating OpenGL® ES Applications</h1>
-<p>The easiest way to use the OpenGL® ES API in a Tizen application is to rely on the <code>Elm_GLView</code> component. The <code>Elm_GLView</code> component is one of the Elementary UI components, which creates an OpenGL® ES target surface and a context. The <code>Elm_GLView</code> component can be embedded in any Tizen UI application. It is basically a wrapper of <code>Evas_GL</code>, the OpenGL®/EGL™ abstraction layer of EFL. By using the <code>Elm_GLView</code> component, you avoid having to consider how the EGL™ environment is coupled with the native windowing systems. Some macros provided by EFL also allow you to use OpenGL® ES APIs directly. In addition, the UI framework can access the surface where the GPU outputs the rendering result and make the entire scene as a combination of 2D and 3D components in a single canvas.</p>
+<p>The easiest way to use the OpenGL® ES API in a Tizen application is to rely on the <code>Elm_GLView</code> component. The <code>Elm_GLView</code> component is one of the Elementary UI components, which creates an OpenGL® ES target surface and a context. The <code>Elm_GLView</code> component can be embedded in any Tizen UI application. It is basically a wrapper of <code>Evas_GL</code>, the OpenGL®/EGL™ abstraction layer of EFL. By using the <code>Elm_GLView</code> component, you avoid having to consider how the EGL™ environment is coupled with the native windowing systems. Some macros provided by EFL also allow you to use OpenGL® ES APIs directly. In addition, the UI framework can access the surface where the GPU outputs the rendering result and make the entire scene as a combination of 2D and 3D components on a single canvas.</p>
<p>The following example shows the steps to create an OpenGL® ES application. From now on, the <code>Elm_GLView</code> component is shortened to GLView.</p>
<ol>
<p align="center"><img alt="Vertex and fragment shader outputs" src="../../images/fragment_output.png" /></p>
-<p>The following example is a simplest fragment shader, which performs just texturing. Given an <code>s_tex0</code> 2D image texture and the <code>v_texCoord</code> interpolated texture coordinates, the shader invokes the built-in <code>texture2D()</code> function to determine the color to be output to the built-in <code>gl_FragColor</code> variable:</p>
+<p>The following example is a simple fragment shader, which performs only texturing. Given an <code>s_tex0</code> 2D image texture and the <code>v_texCoord</code> interpolated texture coordinates, the shader invokes the built-in <code>texture2D()</code> function to determine the color to be output to the built-in <code>gl_FragColor</code> variable:</p>
<pre class="prettyprint">
uniform sampler2D s_tex0;
<h2 id="update" name="update">Automatic Update</h2>
<p>In order to allow GLView to update scenes continuously, you must trigger the GLView rendering at every frame. The <code>Ecore_Animator</code> represents a method to enable the automatic update. It invokes the registered callback at every <code>N</code> seconds where <code>N</code> is the frametime interval set by the <code>ecore_animator_frametime_set()</code> function. Then you can call the <code>elm_glview_changed_set()</code> function at the animator's callback to keep the 3D scene being rendered while the animator works.</p>
-<p>The <code>Ecore_Animator</code> instance can be replaced by <code>Ecore_Timer</code>, which produces the same result as <code>Ecore_Animator</code>. However, since <code>Ecore_Animator</code> provides more advantages in maintaining the updating loop, prefer <code>Ecore_Animator</code> instead of <code>Ecore_Timer</code>. For more information, see the Ecore Animator API (in <a href="../../../../org.tizen.native.mobile.apireference/group__Ecore__Animator__Group.html">mobile</a> and <a href="../../../../org.tizen.native.wearable.apireference/group__Ecore__Animator__Group.html">wearable</a> applications).</p>
+<p>The <code>Ecore_Animator</code> instance can be replaced by <code>Ecore_Timer</code>, which produces the same result as <code>Ecore_Animator</code>. However, since <code>Ecore_Animator</code> provides more advantages in maintaining the update loop, preferably use <code>Ecore_Animator</code> instead of <code>Ecore_Timer</code>. For more information, see the Ecore Animator API (in <a href="../../../../org.tizen.native.mobile.apireference/group__Ecore__Animator__Group.html">mobile</a> and <a href="../../../../org.tizen.native.wearable.apireference/group__Ecore__Animator__Group.html">wearable</a> applications).</p>
<p>The following example adds and deletes an animator with the callback function:</p>
<ol><li>Adding <code>Ecore_Animator</code>
<pre class="prettyprint">
ad->cfg->options_bits = EVAS_GL_OPTIONS_NONE;
</pre>
-<p>Once you have configured the surface behavior, you must initialize the surface using the <code>evas_gl_surface_create()</code> function. This function takes the given Evas_GL object as the first parameter and the pixel format, and the configuration of the rendering surface as the second parameter. The last 2 parameters are the width and height of the surface, which you can recover directly from the window.</p>
+<p>Once you have configured the surface behavior, you must initialize the surface using the <code>evas_gl_surface_create()</code> function. This function takes the given <code>Evas_GL</code> object as the first parameter and the pixel format, and the configuration of the rendering surface as the second parameter. The last 2 parameters are the width and height of the surface, which you can recover directly from the window.</p>
<pre class="prettyprint">
Evas_Coord w, h;
<li>Create a context.
-<p>Create a context for Evas_GL using the <code>evas_gl_context_create()</code> function. You can merge the context with a higher context definition that you must pass as a second parameter.</p>
+<p>Create a context for the <code>Evas_GL</code> object using the <code>evas_gl_context_create()</code> function. You can merge the context with a higher context definition that you must pass as a second parameter.</p>
<pre class="prettyprint">
ad->ctx = evas_gl_context_create(ad->evasgl, NULL);
}
</pre>
-<p>To get the current rotation of the view, in degrees, call the <code>evas_gl_rotation_get()</code> function to properly handle the current rotation of the view. It always returns 0 unless the option <code>EVAS_GL_OPTIONS_CLIENT_SIDE_ROTATION</code> has been set. Indeed, in case of Direct Rendering to the back buffer, the client application is responsible for properly rotating its view. This can generally be done by applying a rotation to a view matrix.</p>
+<p>To get the current rotation of the view, in degrees, call the <code>evas_gl_rotation_get()</code> function to properly handle the current rotation of the view. It always returns 0 unless the option <code>EVAS_GL_OPTIONS_CLIENT_SIDE_ROTATION</code> has been set. Indeed, when Direct Rendering to the back buffer, the client application is responsible for properly rotating its view. This can generally be done by applying a rotation to a view matrix.</p>
</li>
</ul>
<h3>Filtering for Magnification</h3>
-<p>In case of magnification, you have 2 options. The first is <strong>nearest point sampling</strong>. Then, as you can see in the left example below, a block of fragments can be mapped to a single texel. Consequently, a blocky image is often produced. The second option is <strong>bilinear interpolation</strong> illustrated in the right example below. In general, bilinear interpolation is preferred to nearest point sampling.</p>
+<p>For magnification, you have 2 options. The first is <strong>nearest point sampling</strong>. Then, as you can see in the left example below, a block of fragments can be mapped to a single texel. Consequently, a blocky image is often produced. The second option is <strong>bilinear interpolation</strong> illustrated in the right example below. In general, bilinear interpolation is preferred to nearest point sampling.</p>
<p align="center"><strong>Figure: Nearest point sampling (left) vs. bilinear interpolation (right)</strong></p>
<p align="center"><img alt="Nearest point sampling (left) vs. bilinear interpolation (right)" src="../../images/texturing_nearest.png" /> <img alt="Nearest point sampling (left) vs. bilinear interpolation (right)" src="../../images/texturing_bilinear.png" /></p>
<p>To create and bind VBOs:</p>
<ol>
-<li>Use the <code>glGenBuffers()</code> function, which is asked for <code>n</code> buffer objects and returns them in buffers. In general, <code>n</code> is 2: one for vertices and the other for indices.</li>
+<li>Use the <code>glGenBuffers()</code> function to ask for <code>n</code> buffer objects and receive them in buffers. In general, <code>n</code> is 2: one for vertices and the other for indices.</li>
<li>Use the <code>glBindBuffer()</code> function, where the first parameter is either <code>GL_ARRAY_BUFFER</code> or <code>GL_ELEMENT_ARRAY_BUFFER</code>. This specifies what the buffer is used for. The <code>glBindBuffer()</code> function call creates a VBO.</li>
<li>The buffer object is filled with data using the <code>glBufferData()</code> function, where the first parameter is either <code>GL_ARRAY_BUFFER</code> or <code>GL_ELEMENT_ARRAY_BUFFER</code> and the third parameter points to the vertex or index array.</li>
</ol>
<h1>SDL Graphics with Vulkan®</h1>
-<p>Vulkan® is a generation API for high-efficiency access to graphics and computing on modern GPUs. It is an open-standard, cross-platform API designed from the ground-up by industry experts collaborating under the Khronos consortium. It aims to address the inefficiencies of existing 3D APIs, such as OpenGL®, which are designed for single-core processors and lag to map modern hardware. It provides a much lower-level fine-grained control over the GPU to maximize performance and achieve consistent user experience across different operating environments. For general information on Vulkan®, and the comparative merits of Vulkan® and OpenGL®, see the official Khronos <a href="https://www.khronos.org/vulkan/" target="_blank">Vulkan® Web site</a> and <a href="#vulkan_1">OpenGL® vs. Vulkan®</a>.</p>
-<p>The Tizen platform supports the Vulkan API in order to provide the most cutting edge 3D programming tools for you to create high-quality games and real-time graphics in applications. Vulkan® is especially recommended for performance- or latency-sensitive applications. With Vulkan®, you can achieve a much smoother user experience by parallelizing the rendering job across multiple threads which can feed the GPU to the max. Applications demanding explicit control on work submission, synchronization, and less power consumption can seriously consider migrating to Vulkan® as well. Tizen allows the <a href="#render">use of the Vulkan API</a> through <a href="#sdl">SDL</a>.</p>
+<p>Vulkan® is a generation API for high-efficiency access to graphics and computing on modern GPUs. It is an open-standard, cross-platform API designed from the ground up by industry experts collaborating under the Khronos consortium. It aims to address the inefficiencies of existing 3D APIs, such as OpenGL®, which are designed for single-core processors and lag to map modern hardware. It provides a much lower-level fine-grained control over the GPU to maximize performance and achieve consistent user experience across different operating environments. For general information on Vulkan®, and the comparative merits of Vulkan® and OpenGL®, see the official Khronos <a href="https://www.khronos.org/vulkan/" target="_blank">Vulkan® Web site</a> and <a href="#vulkan_1">OpenGL® vs. Vulkan®</a>.</p>
+<p>The Tizen platform supports the Vulkan API in order to provide the most cutting-edge 3D programming tools for you to create high-quality games and real-time graphics in applications. Vulkan® is especially recommended for performance- or latency-sensitive applications. With Vulkan®, you can achieve a much smoother user experience by parallelizing the rendering job across multiple threads which can feed the GPU in an efficient manner. Applications demanding explicit control on work submission, synchronization, and less power consumption can seriously consider migrating to Vulkan® as well. Tizen allows the <a href="#render">use of the Vulkan API</a> through <a href="#sdl">SDL</a>.</p>
<p align="center"><strong>Figure: Vulkan® in Tizen</strong></p>
<p align="center"><img alt="Vulkan in Tizen" src="../../images/vulkan_framework.png" /></p>
<p>To render a triangle using Vulkan® in an SDL application:</p>
<ol>
-<li>Initialize SDL and create an SDL window.
+<li>Initialize the SDL library and create an SDL window.
<p>Before using any other SDL functions, call the <code>SDL_Init()</code> function to properly initialize the SDL library and start each of its various subsystems. The function accepts as a parameter a set of allowed flags OR'd together.</p>
<p>After SDL is initialized successfully, create the <code>SDL_Window</code> instance using the <code>SDL_CreateWindow()</code> function. The parameters define the title of the window, the X and Y position coordinates, width, height, and a set of <code>SDL_WindowFlags</code> OR'd together.</p>
}
</pre>
</li>
-<li>Initialize Vulkan.
+<li>Initialize the Vulkan library.
<p>Create a Vulkan instance, which is the connection between the application and the Vulkan library. To create an instance:</p>
<ol type="a">
<div class="note">
<strong>Note</strong>
- If you have an application based on the Tizen 2.3, use the <a href="migration_guide_n.htm">Migration Guide</a> to make it conform to Tizen 2.4 Application Framework APIs.
+ If you have an application based on Tizen 2.3, use the <a href="migration_guide_n.htm">Migration Guide</a> to make it conform to Tizen 2.4 Application Framework APIs.
</div>
<p>Select the feature you are interested in and see what Tizen offers for your application:</p>
<h2 id="uchar" name="uchar">Unicode Character Database Access with Uchar</h2>
<p>The Uchar API (in <a href="../../../../org.tizen.native.mobile.apireference/group__CAPI__BASE__UTILS__I18N__UCHAR__MODULE.html">mobile</a> and <a href="../../../../org.tizen.native.wearable.apireference/group__CAPI__BASE__UTILS__I18N__UCHAR__MODULE.html">wearable</a> applications) provides low-level access to the Unicode Character Database.</p>
-<p>Unicode assigns each code point (not just the assigned character) values for several properties. Most of them are simple boolean flags, or constants from a small enumerated list. For some properties, values are strings or other relatively more complex types.</p>
+<p>Unicode assigns each code point (not only the assigned character) values for several properties. Most of them are simple boolean flags, or constants from a small enumerated list. For some properties, values are strings or other relatively more complex types.</p>
<p>For more information, see <a href="http://www.unicode.org/ucd/" target="_blank">About the Unicode Character Database</a> and <a href="http://icu-project.org/userguide/properties.html" target="_blank">ICU User Guide chapter on Properties</a>.
</p>
</p>
<p>The third option requires additional information on the variant. The variant codes are vendor and browser-specific. For example, use <code>WIN</code> for Windows, <code>MAC</code> for Macintosh, and <code>POSIX</code> for POSIX. Where there are 2 variants, separate them with an underscore, and put the most important one first. For example, a Traditional Spanish collation might be referenced, with <code>ES</code>, <code>ES</code>, <code>Traditional_WIN</code>.
</p>
-<p>Because a locale is just an identifier for a region, no validity check is performed when you specify a locale. If you want to see whether particular resources are available for the locale you asked for, you must query those resources.
+<p>Because a locale is simply an identifier for a region, no validity check is performed when you specify a locale. If you want to see whether particular resources are available for the locale you asked for, you must query those resources.
</p>
<p> Once you have specified a locale you can query it for information about itself. Use <code>i18n_ulocale_get_language()</code> to get the ISO Language Code. You can use <code>i18n_ulocale_get_display_name()</code> to get the name of the language suitable for display to the user.
</p>
</pre></li></ol>
<h3 id="search" name="search">Searching Text in a Ustring</h3>
-<p>To search a substring in a Ustring:</p>
+<p>To search for a substring in a Ustring:</p>
<ol>
<li>Create a search iterator using the <code>i18n_usearch_create_new()</code> function of the Usearch API (in <a href="../../../../org.tizen.native.mobile.apireference/group__CAPI__BASE__UTILS__I18N__USEARCH__MODULE.html">mobile</a> and <a href="../../../../org.tizen.native.wearable.apireference/group__CAPI__BASE__UTILS__I18N__USEARCH__MODULE.html">wearable</a> applications):
<pre class="prettyprint">
i18n_uenumeration_char_strings_enumeration_create(strings, size, &strings_enum);
</pre>
-<p>In case of <code>i18n_uchar</code> strings, use the <code>i18n_uenumeration_uchar_strings_enumeration_create()</code> function.</p>
+<p>For <code>i18n_uchar</code> strings, use the <code>i18n_uenumeration_uchar_strings_enumeration_create()</code> function.</p>
</li>
<li>Get the number of elements:
}
</pre>
-<p>In case of <code>i18n_uchar</code> strings, use the <code>i18n_uenumeration_unext()</code> function.</p>
+<p>For <code>i18n_uchar</code> strings, use the <code>i18n_uenumeration_unext()</code> function.</p>
</li>
<li>When no longer needed, destroy the enumeration with the <code>18n_uenumeration_destroy()</code> function:
<h2 id="translating" name="translating">Translating Texts Directly</h2>
-<p>The process of marking texts as translatable is not applicable in some cases. For example, it does not work if you are populating a genlist, if you need plurals in the translation, or if you want to do something else than put the translation in an elementary UI component.</p>
+<p>The process of marking texts as translatable is not applicable in some cases. For example, it does not work if you are populating a genlist, if you need plurals in the translation, or if you want to do something else than put the translation in an Elementary UI component.</p>
<p>To retrieve the translation for a given text, use the <code>i18n_get_text()</code> function. The function takes as input a string (the <code>msgid</code> field in the <code>.po</code> file), and returns the translation (the corresponding <code>msgstr</code> field in the <code>.po</code> file).</p>
<h3>Language Changes at Runtime</h3>
-<p>The user can change the system language settings at any time. When that is done, the framework notifies the application, which changes the language used in the Elementary. The UI components receive a <code>language,changed</code> signal (a typical smart event signal), and reset their text.</p>
+<p>The user can change the system language settings at any time. When that is done, the framework notifies the application, which changes the language used in the Elementary. The UI components receive a <code>language,changed</code> signal (a typical smart event signal), and reset their texts.</p>
<p>To handle the framework language change event in the application, add an event handler for it, and use the <code>elm_language_set()</code> function in the event handler code to trigger the emission of the <code>language,changed</code> signal:</p>
msgstr "Cliquez ici"
</pre>
-<p>In case you insert a new line at the top of the <code>some_file.c</code> file, the line indicator changes to look like this:</p>
+<p>If you insert a new line at the top of the <code>some_file.c</code> file, the line indicator changes to look like this:</p>
<pre class="prettyprint">
#: some_file.c:44 another_file.c:41
</pre>
-<p>Obviously, in non-trivial projects, such changes often happen. If you use source control and commit such changes even though no actual translation change has happened, each commit probably contains a change to the <code>.po</code> files. This hampers the readability of the change history, and in case several people are working in parallel and need to merge their changes, this creates huge merge conflicts each time.</p>
+<p>In non-trivial projects, such changes often happen. If you use source control and commit such changes even though no actual translation changes were made, each commit probably contains a change to the <code>.po</code> files. This hampers readability of the change history, and if several people are working in parallel and need to merge their changes, this creates extensive merge conflicts each time.</p>
<p>For source control, only commit changes to <code>.po</code> files when there are actual translation changes, not because line comments have changed.</p>
</li>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<li><a href="#prerequisites">Prerequisites</a></li>
<li><a href="#sensorlistener">Creating a Sensor Listener</a></li>
- <li><a href="#subscribe">Subscribing for Sensor Events</a></li>
+ <li><a href="#subscribe">Subscribing to Sensor Events</a></li>
<li><a href="#record">Requesting Sensor Data Recording</a></li>
<li><a href="#query">Querying Recorded Sensor Data</a></li>
<li><a href="#accelerometer">Accelerometer</a></li>
<div class="note">
<strong>Note</strong>
- All devices do not support all sensors, so each sensor is not necessarily available on all devices. You can <a href="#sensorlistener">check whether a sensor is supported</a>. For more information, see <a href="../device/system_n.htm">System Information</a>.
+ Not all devices support all sensors, so each sensor is not necessarily available on all devices. You can <a href="#sensorlistener">check whether a sensor is supported</a>. For more information, see <a href="../device/system_n.htm">System Information</a>.
</div>
<p align="center" class="Table"><strong>Table: Supported sensor types</strong></p>
</pre>
</li>
<li>For a specific supported sensor type, a device can have multiple sensors.
-<p>You can acquire all sensors or just the default sensor (designated by the device vendor) of a given type. The following example shows how to get the default accelerometer of the device:</p>
+<p>You can acquire all sensors or only the default sensor (designated by the device vendor) of a given type. The following example shows how to get the default accelerometer of the device:</p>
<pre class="prettyprint">
sensor_h sensor;
sensor_get_default_sensor(SENSOR_ACCELEROMETER, &sensor);
</li>
</ol>
-<h2 id="subscribe" name="subscribe">Subscribing for Sensor Events</h2>
+<h2 id="subscribe" name="subscribe">Subscribing to Sensor Events</h2>
-<p>If a listener is created successfully, it is able to observe sensor data changes through the listener. In addition, you can set several parameters, including the update interval of the sensor data and the power-save behavior of the listener. The following example shows how to set the parameters and listen to changes of sensor data:</p>
+<p>If a listener is created successfully, it is able to observe sensor data changes through the listener. In addition, you can set several parameters, including the update interval of the sensor data and the power-save behavior of the listener. The following example shows how to set the parameters and listen for changes in sensor data:</p>
<ol>
-<li>To listen to sensor events, define a callback function and register it to the listener:
+<li>To listen for sensor events, define a callback function and register it to the listener:
<pre class="prettyprint">
/* Define callback */
void
<p>In the above example, the update interval for the sensor data is set to 100 ms.</p>
</li>
-<li>To listen to sensor events, start the listener:
+<li>To listen for sensor events, start the listener:
<pre class="prettyprint">
sensor_listener_start(listener);
</pre>
<pre class="prettyprint">
sensor_listener_set_attribute_int(listener, SENSOR_ATTRIBUTE_PAUSE_POLICY, SENSOR_PAUSE_NONE);
</pre>
-<p>The above example makes the listener to listen for the sensor data regardless of the display state and the power-save mode. However, it does not prevent the device from going to the sleep mode. To listen for the sensor data, the device must be awake anyway.</p>
+<p>The above example makes the listener listen for the sensor data regardless of the display state and the power-save mode. However, it does not prevent the device from going to sleep mode. To listen for the sensor data, the device must be awake anyway.</p>
</li>
</ul>
</li>
<p>Tizen supports long-term data recording for specific sensor types. For example, it can collect pedometer data for a month, by simply requesting the device to record pedometer data:</p>
<ol>
-<li>All sensor types cannot be recorded. Check whether a sensor is supported and allows recording on the current device before actually making the record request.
+<li>Not all sensor types can be recorded. Check whether a sensor is supported and allows recording on the current device before actually making the record request.
<pre class="prettyprint">
bool supported = false;
</pre>
</li>
-<li>You can set various recording options based on your needs.
-<p>For example, in case of the pedometer, its retention period can be designated. The following example shows how to create an option handle to record pedometer data for a month:</p>
+<li>You can set various recording options according to your needs.
+<p>For example, for the pedometer, its retention period can be designated. The following example shows how to create an option handle to record pedometer data for a month:</p>
<pre class="prettyprint">
sensor_recorder_option_h option;
<h2 id="query" name="query">Querying Recorded Sensor Data</h2>
-<p>You can query the recorded sensor data with several query parameters. The query parameters differ between sensor types. In case of the pedometer, for example, you can get the daily step counts for the last 7 days by setting the necessary parameters:</p>
+<p>You can query the recorded sensor data with several query parameters. The query parameters differ between sensor types. For the pedometer, for example, you can get the daily step counts for the last 7 days by setting the necessary parameters:</p>
<ol>
<li>Create a query.
<h2 id="accelerometer" name="accelerometer">Accelerometer</h2>
<p>The accelerometer measures changes in the velocity of a device. It is a combination of gravity and linear acceleration components. The accelerometer measures the device's accelerometer vector in 3 axes relative to its body frame.</p>
-<p>An acceleration shift of 1g always exists on the axis aligned to Earth's gravity. If the device is at rest, the sensor data reads 1g (the gravity offset) on one of the device axis and tells you which device axis is aligned to the direction of gravity. A falling device which has reached terminal velocity ideally shows the accelerometer value of 0 on all axis. The change in the effect of Earth's gravity is observed on the 3 device axes by rotating the device along any of the 3 axes. </p>
+<p>An acceleration of 1g always exists on the axis aligned to Earth's gravity. If the device is at rest, the sensor data reads 1g (the gravity offset) on one of the device axes and tells you which device axis is aligned to the direction of gravity. A falling device which has reached terminal velocity ideally shows the accelerometer value of 0 on all axes. The change in the effect of Earth's gravity is observed on the 3 device axes by rotating the device along any of the 3 axes. </p>
<p>The linear acceleration components which correspond to the measure of the linear motion subjected on the device can be obtained by removing the gravity components from the accelerometer data.</p>
<p>The accelerometer provides 3 components of acceleration (X, Y, and Z), as the following figure illustrates.</p>
<p align="center"><strong>Figure: Accelerometer vector and axes</strong></p>
<p align="center"><img alt="Accelerometer vector and axes" src="../../images/sensor_types_accelerometer_vector.png" /></p>
-<p>The accelerometer outputs 4 values: 3 Cartesian axis values and a timestamp. The accelerometer sensor measures and returns axes values in "m/s<sup>2</sup>" (meters per second squared). When a device is moved in the ±X, ±Y, or ±Z direction, the corresponding output increases (+) or decreases (-).</p>
+<p>The accelerometer outputs 4 values: 3 Cartesian axis values and a timestamp. The accelerometer sensor measures and returns the axes' values in "m/s<sup>2</sup>" (meters per second squared). When a device is moved in the ±X, ±Y, or ±Z direction, the corresponding output increases (+) or decreases (-).</p>
<p>The following table lists the measurement data that the accelerometer provides.</p>
<p align="center" class="Table"><strong>Table: Measurement data detected by the accelerometer</strong></p>
</table>
<h2 id="mag_rotation" name="mag_rotation">Geomagnetic Rotation Vector Sensor</h2>
- <p>The geomagnetic rotation vector sensor is the output of a software/hardware-based sensor fusion solution which uses the accelerometer and magnetic sensors to compute the orientation of the device. In this sensor, the computed orientation is free of any drift, but it is inaccurate compared to a sensor fusion solution using the gyroscope sensor. The geomagnetic rotation vector sensor represents the orientation of the device as a combination of an angle and an axis in which the device has rotated through a specific angle around an axis (x, y, or z).</p>
+ <p>The geomagnetic rotation vector sensor is the output of a software/hardware-based sensor fusion solution which uses the accelerometer and magnetic sensors to compute the orientation of the device. In this sensor, the computed orientation is free of any drift, but it is inaccurate compared to a sensor fusion solution using the gyroscope sensor. The geomagnetic rotation vector sensor represents the orientation of the device as a combination of an angle and an axis on which the device has rotated through a specific angle around an axis (X, Y, or Z).</p>
<p>The following table lists the measurement data that the geomagnetic rotation vector sensor provides.</p>
<p align="center" class="Table"><strong>Table: Measurement data detected by the geomagnetic rotation vector sensor</strong></p>
</table>
<h2 id="gravity" name="gravity">Gravity Sensor</h2>
- <p>The gravity sensor is a virtual sensor derived from the 3-axis acceleration sensor. The 3-axis gravity components provide a measure of the effect of Earth's gravity observed on the device reference axes. The gravity components measured on a device vary based on the change in the device orientation, and hence they provide a measure of the rotation subjected to the device.</p>
+ <p>The gravity sensor is a virtual sensor derived from the 3-axis acceleration sensor. The 3-axis gravity components provide a measure of the effect of Earth's gravity observed on the device reference axes. The gravity components measured on a device vary based on changes in the device orientation, and hence they provide a measure of the rotation to which the device is subjected.</p>
<p align="center"><strong>Figure: Gravity sensor vector and axes</strong></p>
<p align="center"><img alt="Gravity sensor vector and axes" src="../../images/sensor_types_gravity_frame.png" /></p>
<p>The gravity sensor outputs 4 values: 3 Cartesian axis values and a timestamp. The gravity sensor measures and returns axes values in "m/s<sup>2</sup>" (meters per second squared). When a device is rotated in the ±X, ±Y, or ±Z direction, the corresponding output increases (+) or decreases (-).</p>
</table>
<h2 id="gyro_rotation" name="gyro_rotation">Gyroscope Rotation Vector Sensor</h2>
- <p>The gyroscope rotation vector sensor is the output of a software/hardware-based sensor fusion solution which uses the accelerometer and gyroscope to compute the orientation of the device. In this sensor, the pitch and roll equivalent representations are free of drift while the azimuth equivalent component is allowed to drift due to the absence of the magnetic sensor. The gyroscope rotation vector sensor represents the orientation of the device as a combination of an angle and an axis in which the device has rotated through a specific angle around an axis (x, y, or z).</p>
+ <p>The gyroscope rotation vector sensor is the output of a software/hardware-based sensor fusion solution which uses the accelerometer and gyroscope to compute the orientation of the device. In this sensor, the pitch and roll equivalent representations are free of drift while the azimuth equivalent component is allowed to drift due to the absence of the magnetic sensor. The gyroscope rotation vector sensor represents the orientation of the device as a combination of an angle and an axis on which the device has rotated through a specific angle around an axis (X, Y, or Z).</p>
<p>The following table lists the measurement data that the gyroscope rotation vector sensor provides.</p>
<p align="center" class="Table"><strong>: Measurement data detected by the gyroscope rotation vector sensor</strong></p>
<tr>
<td>values[0]: X</td>
<td><code>float</code></td>
- <td>μT (micro Tesla)</td>
+ <td>µT (micro Tesla)</td>
</tr>
<tr>
<td>values[1]: Y</td>
<td><code>float</code></td>
- <td>μT (micro Tesla)</td>
+ <td>µT (micro Tesla)</td>
</tr>
<tr>
<td>values[2]: Z</td>
<td><code>float</code></td>
- <td>μT (micro Tesla)</td>
+ <td>µT (micro Tesla)</td>
</tr>
</tbody>
</table>
</table>
<h2 id="rotation" name="rotation">Rotation Vector Sensor</h2>
- <p>The rotation vector sensor represents the orientation of the device as a combination of an angle and an axis, in which the device has rotated through a specific angle around an axis (x, y, or z). The rotation vector is the output of a software/hardware-based sensor fusion solution, which uses the accelerometer, gyroscope, and magnetic sensor as inputs to compute the orientation of the device.</p>
+ <p>The rotation vector sensor represents the orientation of the device as a combination of an angle and an axis, in which the device has rotated through a specific angle around an axis (X, Y, or Z). The rotation vector is the output of a software/hardware-based sensor fusion solution, which uses the accelerometer, gyroscope, and magnetic sensor as inputs to compute the orientation of the device.</p>
<p>The following table lists the measurement data that the rotation vector sensor provides.</p>
<p align="center" class="Table"><strong>Table: Measurement data detected by the rotation vector</strong></p>
<tr>
<td>values[0]: X</td>
<td><code>float</code></td>
- <td>μT (micro Tesla)</td>
+ <td>µT (micro Tesla)</td>
</tr>
<tr>
<td>values[1]: Y</td>
<td><code>float</code></td>
- <td>μT (micro Tesla)</td>
+ <td>µT (micro Tesla)</td>
</tr>
<tr>
<td>values[2]: Z</td>
<td><code>float</code></td>
- <td>μT (micro Tesla)</td>
+ <td>µT (micro Tesla)</td>
</tr>
<tr>
<td>values[3]: X-axis bias</td>
<td><code>float</code></td>
- <td>μT (micro Tesla)</td>
+ <td>µT (micro Tesla)</td>
</tr>
<tr>
<td>values[4]: Y-axis bias</td>
<td><code>float</code></td>
- <td>μT (micro Tesla)</td>
+ <td>µT (micro Tesla)</td>
</tr>
<tr>
<td>values[5]: Z-axis bias</td>
<td><code>float</code></td>
- <td>μT (micro Tesla)</td>
+ <td>µT (micro Tesla)</td>
</tr>
</tbody>
</table>
<div id="container"><div id="contents"><div class="content">
<h1>Geofences</h1>
-<p>A geofence is a virtual perimeter for a real-world geographic area. A geofence is defined by either a geopoint with a radius in case of geopoint geofences, or a MAC address in case of Wi-Fi and Bluetooth geofences. The geofence feature alerts the user when the geofence state changes (the user crosses the perimeter).</p>
+<p>A geofence is a virtual perimeter for a real-world geographic area. A geofence is defined by either a geopoint with a radius for geopoint geofences, or a MAC address for Wi-Fi and Bluetooth geofences. The geofence feature alerts the user when the geofence state changes (the user crosses the perimeter).</p>
<p>This feature is supported in mobile applications only.</p>
<div class="note">
<strong>Note</strong>
- This event callback is used to let the user know whether the request is successful in the server side. This event callback is invoked only in case of an asynchronous API. In case of a synchronous API, an error is immediately returned.
+ This event callback is used to let the user know whether the request is successful on the server side. This event callback is invoked only in the case of an asynchronous API. For a synchronous API, an error is immediately returned.
</div>
</li></ol>
<p>You can identify the current device states and take applicable actions.</p>
</li>
<li>Event triggers
-<p>You can trigger events when the sensor data meets predefined conditions. In some cases, you can also listen to different movement states (started, in-progress, and ended).</p>
+<p>You can trigger events when the sensor data meets predefined conditions. In some cases, you can also listen for different movement states (started, in-progress, and ended).</p>
</li>
</ul>
<p align="center"><strong>Figure: Face-down event</strong></p>
<p align="center"><img alt="Face-down event" src="../../images/face_down.png" /></p></li>
<li>Wrist up
-<p>The event occurs when wrist-up gesture is performed (in case of a watch device).</p>
+<p>The event occurs when wrist-up gesture is performed (for a watch device).</p>
<p align="center"><strong>Figure: Wrist-up event</strong></p>
<p align="center"><img alt="Wrist-up event" src="../../images/wrist_up.png" /></p></li>
</ul>
<p>If the application registered multiple gestures to a single callback function, the input parameter gesture can be used to distinguish the gesture received.</p>
<p>Some gestures can return different types of events. For example, <code>GESTURE_SHAKE</code> can return <code>GESTURE_SHAKE_DETECTED</code> or <code>GESTURE_SHAKE_FINISHED</code>.</p>
-<p>In case of <code>GESTURE_TILT</code>, the <code>gesture_get_tilt()</code> function can be used to extract the tilting angles.</p>
+<p>For <code>GESTURE_TILT</code>, the <code>gesture_get_tilt()</code> function can be used to extract the tilting angles:</p>
<pre class="prettyprint">
int x;
<p align="center"><strong>Figure: Location settings and indicator</strong></p>
<p align="center"><img alt="Location settings and indicator" src="../../images/location_setting_and_indicator.png" /></p>
-<p>The location-related functions work differently based on whether the location settings are used.</p>
+<p>The location-related functions work differently depending on which location settings are used.</p>
<p>The <strong>GPS</strong> setting controls the Global Positioning System usage. It uses GPS satellite signals and provides accurate positioning services, generally outdoors. The <strong>Wireless networks</strong> setting enables the usage of network-based positioning technology, which includes Wi-Fi and cell tower-based positioning, and improves the coverage of positioning services to indoors.</p>
<p>All location settings are initially enabled, if the device supports GPS. To disable them, the user must manually toggle the buttons. The manual task required from the user is understood as an implicit user consent.</p>
<p class="toc-title">Related Info</p>
<ul class="toc">
<li><a href="../../../../org.tizen.training/html/native/feature/app_sensor_n.htm">Creating Applications with Sensors</a></li>
+ <li><a href="../../../../org.tizen.training/html/native/feature/best_practice_battery_n.htm">Best Practices for Location</a></li>
</ul>
</div></div>
</div>
<li>Discovering and selecting a map provider
<p>You can also <a href="#start">specify basic maps preferences</a>.</p></li>
<li>Geocoding and reverse geocoding
- <p>You can <a href="#geocode">get the geocode</a> (geographical coordinates) of a place based on an address, or the reverse geocode (address) based on the geographical coordinates (latitude and longitude).</p></li>
+ <p>You can <a href="#geocode">get the geocode</a> (geographical coordinates) of a place from an address, or the reverse geocode (address) from the geographical coordinates (latitude and longitude).</p></li>
<li>Searching places
<p>You can <a href="#search_place">query place information</a>, corresponding to specified search keys and filters.</p></li>
<li>Searching routes
<h2 id="geocode">Geocodes</h2>
<p>The following geocode request types are provided:</p>
<ul>
- <li>Get place coordinates based on a free text address.</li>
- <li>Get place coordinates based on a free text address within a specified geographical area.</li>
- <li>Get place coordinates based on a structured address (a structure with fields, such as city, street, and building number).</li>
+ <li>Get place coordinates from a free text address.</li>
+ <li>Get place coordinates from a free text address within a specified geographical area.</li>
+ <li>Get place coordinates from a structured address (a structure with fields, such as city, street, and building number).</li>
</ul>
<p>After performing the <a href="#use_geocode">geocode service request</a>, you receive the geocode response, which is a geographical location, specified with latitude and longitude values.</p>
<p>Only 1 type of reverse geocode request is provided:</p>
<ul>
- <li>Get a structured address based on place coordinates.</li>
+ <li>Get a structured address from place coordinates.</li>
</ul>
- <p>You can <a href="#address">parse the reverse geocode response</a> to use its details. The response consists of structured address information, comprising, for example, of a street name, building number, city name, postal code, district name, state name, and country.</p>
+ <p>You can <a href="#address">parse the reverse geocode response</a> to use its details. The response contains structured address information, consisting of, for example, a street name, building number, city name, postal code, district name, state name, and country.</p>
<h2 id="search_place">Place Search</h2>
<ul>
<li>Query place information within a specific distance around a specified geographical location.</li>
<li>Query place information within a specified geographical area.</li>
- <li>Query place information based on a free text address within a specified geographical area.</li>
+ <li>Query place information from a free text address within a specified geographical area.</li>
</ul>
- <p>After performing the <a href="#use_search_place">place service request</a>, you receive the place search response. You can <a href="#place">parse the place search response</a> to use its details. The response consists of structured place information, comprising, for example, of a place ID, name and URL, address, geographical location and distance from the center of the search area, place category, rating, review, and image.</p>
+ <p>After performing the <a href="#use_search_place">place service request</a>, you receive the place search response. You can <a href="#place">parse the place search response</a> to use its details. The response contains structured place information, consisting of, for example, a place ID, name and URL, address, geographical location and distance from the center of the search area, place category, rating, review, and image.</p>
<div class="note">
<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 contains structured route information, consisting of, for example, a route ID, geographical coordinates of the start and destination points, route bounding box, transportation mode, and total distance and duration.</p>
<p>You can <a href="#maps_object">create objects in the widget</a>. The following view object types are provided:</p>
<ul>
<li>Marker based on a specified geographical location, image, and marker type.</li>
- <li>Polyline based on a specified geographical locations, color, and width.</li>
- <li>Polygon based on a specified geographical locations and color.</li>
+ <li>Polyline based on specified geographical locations, color, and width.</li>
+ <li>Polygon based on specified geographical locations and color.</li>
</ul>
<p>The object properties can be changed after the object has been created.</p>
- <p>The map view widget can <a href="#maps_event">handle events</a>. The asynchronous view event responses are implemented with callback functions based on the view event type:</p>
+ <p>The map view widget can <a href="#maps_event">handle events</a>. The asynchronous view event responses are implemented with callback functions corresponding to the view event type:</p>
<ul>
<li><code>MAPS_VIEW_EVENT_GESTURE</code>: User gesture is detected over the widget.</li>
<li><code>MAPS_VIEW_EVENT_ACTION</code>: Predefined action occurs.</li>
</pre>
</li>
-<li>Use the <code>maps_service_search_place_by_address()</code> function for a search for a place based on an address within a specified geographic boundary:
+<li>Use the <code>maps_service_search_place_by_address()</code> function to search for a place based on an address within a specified geographic boundary:
<pre class="prettyprint">
maps_area_h boundary = NULL;
/*
<li>View a graph of your recent usage for a certain period of time, such as the past day or month.</li>
</ol>
-<p>If you exceed rate limits, the server's response to your query contains a specific <a href="https://en.wikipedia.org/wiki/List_of_HTTP_status_codes" target="_blank">HTTP status code</a> in the header. The typical errors for exceeded limits are "403 Forbidden" and "429 Too Many Requests".</p>
+<p>If you exceed the rate limits, the server's response to your query contains a specific <a href="https://en.wikipedia.org/wiki/List_of_HTTP_status_codes" target="_blank">HTTP status code</a> in the header. The typical errors for exceeded limits are "403 Forbidden" and "429 Too Many Requests".</p>
-<p>All queries do not count towards your rate limit. Mapzen uses server caching to deliver commonly requested content as quickly as possible. Queries served from the cache are not included in the rate limit count. For example, queries can be served from the cache when the user browses a map with vector tiles in a popular extent or repeatedly performs an identical geocoding search.</p>
+<p>Not all queries count towards your rate limit. Mapzen uses server caching to deliver commonly requested content as quickly as possible. Queries served from the cache are not included in the rate limit count. For example, queries can be served from the cache when the user browses a map with vector tiles in a popular extent or repeatedly performs an identical geocoding search.</p>
<script type="text/javascript" src="../../scripts/jquery.zclip.min.js"></script>
<script type="text/javascript" src="../../scripts/showhide.js"></script>
<strong>Note</strong>
Simultaneous use of multiple camera sensors is not allowed.
<p>The target device often supports more functionalities than the emulator.</p>
- <p>The behavior of the shutter sound can differ according to the legislation of each country.</p>
+ <p>The behavior of the shutter sound can vary depending on the legislation of each country.</p>
</div>
</li>
<li>Releasing resources
</ul>
-<p>Once you know the active camera and its current orientation angle, or tilt, you can calculate how to rotate the display to match the camera orientation, and whether and how to flip the display to create the mirror effect in case the front camera is active.</p>
+<p>Once you know the active camera and its current orientation angle, or tilt, you can calculate how to rotate the display to match the camera orientation, and whether and how to flip the display to create the mirror effect if the front camera is active.</p>
<p>To correctly rotate the display as the camera orientation changes, think about the orientation and direction of the physical camera lens relative to the display. If the camera faces away from the display, the camera orientation is calculated clockwise across the display. If the camera faces the same way as the display, the camera orientation is calculated counter-clockwise across the display. For example, if the camera and display face in opposite directions, the right side of the image is at 90 degrees, and if the camera and display face in the same direction, the right side is at 270 degrees (360 - 90).</p>
<div class="note">
<strong>Note</strong>
- In case of an overlay surface, when the device orientation changes, the displayed camera preview does not rotate automatically. If you want to rotate the display according to the device orientation, use the <code>camera_set_display_rotation()</code> function within the <code>app_device_orientation_cb()</code> callback used by the application.
- <p>In case of an Evas surface, the Evas object for the camera display is rotated by the window manager used by the application, not by the <code>camera_set_display_rotation()</code> function.</p>
+ For an overlay surface, when the device orientation changes, the displayed camera preview does not rotate automatically. If you want to rotate the display according to the device orientation, use the <code>camera_set_display_rotation()</code> function within the <code>app_device_orientation_cb()</code> callback used by the application.
+ <p>For an Evas surface, the Evas object for the camera display is rotated by the window manager used by the application, not by the <code>camera_set_display_rotation()</code> function.</p>
</div>
<h2 id="photo" name="photo">Taking a Photo</h2>
<li>
-<p>Set the barcode type. In case of the QR type, also set the error correction level, encoding mode, and version.</p>
+<p>Set the barcode type. For the QR type, also set the error correction level, encoding mode, and version.</p>
<pre class="prettyprint">
bargendata.type = MV_BARCODE_QR;
<li>Resizing
<p>You can <a href="#resize">change the image resolution</a>.</p></li>
<li>Rotation
-<p>You can <a href="#rotate">change the image angle</a> around the x or y axis.</p></li>
+<p>You can <a href="#rotate">change the image angle</a> around the X or Y axis.</p></li>
<li>Crop
<p>You can <a href="#crop">remove the outer parts of an image</a> or change the aspect ratio.</p></li>
<li>Decoding from a file or memory and encoding to a file or memory
<p>You can extract features of an image object and recognize it from specific images. You can also track the image object in your application.</p>
-<p>The main features of Media Vision Image API include:</p>
+<p>The main features of the Media Vision Image API include:</p>
<ul>
<li>Recognizing images
<div id="container"><div id="contents"><div class="content">
<h1>Media Content and Metadata</h1>
-<p>The media content and metadata features introduce how you can handle media content and its metadata in your application. You can manage and search various media content on the device, such as media files, bookmarks, albums, and playlists. You can also access the MIME type information, and extract and edit the metadata of the media files.</p>
+<p>The media content and metadata features introduce how you can handle media content and its metadata in your application. You can manage and search for various media content on the device, such as media files, bookmarks, albums, and playlists. You can also access the MIME type information, and extract and edit the metadata of the media files.</p>
<p>You can use the following media content and metadata features in your native applications:</p>
<ul>
<li><a href="media_content_n.htm">Media Content</a>
-<p>You can update database details due to file (or folder) creation or deletion. If a received file (or folder) does not exist in the file system, it is removed from the database. You can also retrieve a list of media folders, retrieve a list of media items, and monitor changes in the media database. In case of the media folders, you can search for specific folders, read folder information, and retrieve folder content.</p></li>
+<p>You can update database details due to file (or folder) creation or deletion. If a received file (or folder) does not exist in the file system, it is removed from the database. You can also retrieve a list of media folders, retrieve a list of media items, and monitor changes in the media database. You can search for specific media folders and read their information, and retrieve media folder content.</p></li>
<li><a href="metadata_n.htm">Metadata</a>
<ul>
<li>Media content
<p>You can update database details due to file (or folder) creation or deletion. If a received file (or folder) does not exist in the file system, it is removed from the database.</p>
-<p>You can also <a href="#folder_list">retrieve a list of media folders</a>, <a href="#item_list">retrieve a list of media items</a>, and <a href="#update">monitor changes</a> in the media database. In case of the media folders, you can <a href="#find">search for specific folders</a>, <a href="#read_folder">read folder information</a>, and <a href="#folder_content">retrieve folder content</a>.</p></li>
+<p>You can also <a href="#folder_list">retrieve a list of media folders</a>, <a href="#item_list">retrieve a list of media items</a>, and <a href="#update">monitor changes</a> in the media database. You can <a href="#find">search for specific media folders</a> and <a href="#read_folder">read their information</a>, and <a href="#folder_content">retrieve media folder content</a>.</p></li>
<li>Media information
<p>You can update the media database due to file creation, deletion, or update on the device. You can <a href="#info">retrieve media information</a>, and add <a href="#insert">media files</a> and <a href="#scan">media folders</a> to the database.</p>
-<p>You can also retrieve <a href="#media_info">general information about the media more specific information about the media type</a>.</p></li>
+<p>You can also retrieve <a href="#media_info">general information about the media and more specific information about the media type</a>.</p></li>
<li>Media bookmarks
-<p>You can <a href="#inserting">insert</a>, <a href="#finding">search for</a>, <a href="#reading">read</a>, and <a href="#removing">remove</a> bookmarks of the video and audio files.</p></li>
+<p>You can <a href="#inserting">insert</a>, <a href="#finding">search for</a>, <a href="#reading">read</a>, and <a href="#removing">remove</a> bookmarks for video and audio files.</p></li>
<li>Filter
<p>You can <a href="#filter">create a filter</a> to find specific media items.</p></li>
<li>Media playlists
-<p>You can <a href="#create_playlist">add</a> or <a href="#delete_playlist">delete</a> a playlist of the video and audio files, and add media files to a created playlist. In addition, you can also <a href="#find_playlist">search for playlists</a> and <a href="#read_playlist">read playlist information</a>.</p></li>
+<p>You can <a href="#create_playlist">add</a> or <a href="#delete_playlist">delete</a> a playlist of video and audio files, and add media files to a created playlist. In addition, you can also <a href="#find_playlist">search for playlists</a> and <a href="#read_playlist">read playlist information</a>.</p></li>
<li>Media tags
<p>You can access the tag information for the media files in the database. You can, for example, <a href="#tag_add">add media tags</a>, <a href="#tag_list">retrieve tag information</a>, and <a href="#tag_delete">delete tags</a>.</p></li>
<li>Media albums
-<p>You can manage an album of the audio file. You can, for example, <a href="#findingall">search for albums</a>, <a href="#findinginfo">retrieve album content</a>, and <a href="#read_album">read album information</a>.</p></li>
+<p>You can manage an album of audio files. You can, for example, <a href="#findingall">search for albums</a>, <a href="#findinginfo">retrieve album content</a>, and <a href="#read_album">read album information</a>.</p></li>
<li>Media item groups
<p>You can manage a collection of media items as a group, when the items have the same value of a given property. You can, for example, <a href="#find_groups">search for groups</a> and <a href="#read_group">read group information</a>.</p></li>
<li>Media storages
}
</pre></li>
<li>To find the items satisfying certain criteria, or modify the results in a specific way, create a filter and set its properties. For a detailed list of condition fields (such as <code>MEDIA_TYPE</code>) and their values (such as <code>MEDIA_CONTENT_TYPE_IMAGE</code> and <code>MEDIA_CONTENT_TYPE_VIDEO</code>), see the <code>media_content_type.h</code> header file.
-<p>The following example filters media items so that only image and video files are included in the result. The filter is case-insensitive, and the results are sorted in a descending order based on the item display name. For more information on the filter properties, see <a href="#filter">Setting up a Filter</a>. </p>
+<p>The following example filters media items so that only image and video files are included in the result. The filter is case-insensitive, and the results are sorted in descending order by item display name. For more information on the filter properties, see <a href="#filter">Setting up a Filter</a>. </p>
<pre class="prettyprint">
#define BUFLEN 200
<p>To find albums in the system and filter the results:</p>
<ol>
<li><p>To find the albums satisfying certain criteria, or modify the results in a specific way, create a filter and set its properties.</p>
-<p>The following example filters media albums so that only albums with the artist named "Tizen" are included in the result. The filter is case-insensitive, and the results are sorted in a descending order based on the album display name. For more information on the filter properties, see <a href="#filter">Setting up a Filter</a>.</p>
+<p>The following example filters media albums so that only albums with the artist named "Tizen" are included in the result. The filter is case-insensitive, and the results are sorted in descending order by album display name. For more information on the filter properties, see <a href="#filter">Setting up a Filter</a>.</p>
<pre class="prettyprint">
#define BUFLEN 200
<ol>
<li><p>To find the bookmarks satisfying certain criteria, or modify the results in a specific way, create a filter and set its properties.</p>
-<p>The following example filters bookmarks so that only the bookmarks set at the 220th second of the file or later are included in the result. The filter is case-insensitive, and the results are sorted in an ascending order based on the time they mark in the file. The file also defines an offset where only the first 3 results are returned. For more information on the filter properties, see <a href="#filter">Setting up a Filter</a>.</p>
+<p>The following example filters bookmarks so that only the bookmarks set at the 220th second of the file or later are included in the result. The filter is case-insensitive, and the results are sorted in ascending order by the time point they mark in the file. The file also defines an offset where only the first 3 results are returned. For more information on the filter properties, see <a href="#filter">Setting up a Filter</a>.</p>
<pre class="prettyprint">
filter_h filter = NULL;
</li>
<li><p>Set a sorting order using the <code>media_filter_set_order()</code> function.</p>
-<p>The following example sorts the results in an ascending order based on the artist name. The sorting is case-sensitive.</p>
+<p>The following example sorts the results in ascending order by artist name. The sorting is case-sensitive.</p>
<pre class="prettyprint">
media_filter_set_order(filter, MEDIA_CONTENT_ORDER_ASC, MEDIA_ARTIST,
<ol>
<li><p>To find only folders satisfying certain criteria, or modify the results in a specific way, create a filter and set its properties.</p>
-<p>The following example filters media folders so that only folders named "Downloads" found in the internal storage are included in the result. The filter is case-insensitive, and the results are sorted in an ascending order based on the modified time. For more information on the filter properties, see <a href="#filter">Setting up a Filter</a>.</p>
+<p>The following example filters media folders so that only folders named "Downloads" found in the internal storage are included in the result. The filter is case-insensitive, and the results are sorted in ascending order by modified time. For more information on the filter properties, see <a href="#filter">Setting up a Filter</a>.</p>
<pre class="prettyprint">
filter_h filter = NULL;
}
</pre></li>
<li>To find the items satisfying certain criteria, or modify the results in a specific way, create a filter and set its properties.
-<p>The following example filters media items so that only image and video items are included in the result. The filter is case-insensitive, and the results are sorted in a descending order based on the item display name. For more information on the filter properties, see <a href="#filter">Setting up a Filter</a>.</p>
+<p>The following example filters media items so that only image and video items are included in the result. The filter is case-insensitive, and the results are sorted in descending order by item display name. For more information on the filter properties, see <a href="#filter">Setting up a Filter</a>.</p>
<pre class="prettyprint">
#define BUFLEN 200
GList *all_item_list = NULL; /* Include glib.h */
snprintf(buf, BUFLEN, "%s LIKE '%%.jpg'", MEDIA_DISPLAY_NAME);
media_filter_set_condition(filter, buf, MEDIA_CONTENT_COLLATE_DEFAULT);
</pre></li>
-<li>To group media files based on the MIME type:
+<li>To group media files by MIME type:
<ol type="a"><li>
<p>To find the number of MIME type-related groups, use the <code>media_group_get_group_count_from_db()</code> function:</p>
</tr>
<tr>
<td><code>Added time</code></td>
- <td>The time the media content was added in the database</td>
+ <td>The time the media content was added to the database</td>
</tr>
<tr>
<td><code>Modified time</code></td>
</tr>
<tr>
<td><code>Favorite</code></td>
- <td>Favorite of the media content</td>
+ <td>Favorite status of the media content</td>
</tr>
<tr>
<td><code>Author</code></td>
- <td>The author of the media content</td>
+ <td>Author of the media content</td>
</tr>
<tr>
<td><code>Provider</code></td>
</tr>
<tr>
<td><code>Model</code></td>
- <td>Model name of the image</td>
+ <td>Model name of the camera that created the image</td>
</tr>
<tr>
<td><code>Orientation</code></td>
</tr>
<tr>
<td><code>Album</code></td>
- <td>Album of the video content</td>
+ <td>Album information for the video content</td>
</tr>
<tr>
<td><code>Artist</code></td>
<li>
-<p>If the <code>media_packet</code> contains codec data, such as SPS or PPS in case of H.264, set the codec config flag:</p>
+<p>If the <code>media_packet</code> contains codec data, such as SPS or PPS for H.264, set the codec config flag:</p>
<pre class="prettyprint">
ret = media_packet_set_flags(pkt, MEDIA_PACKET_CODEC_CONFIG);
<ul>
<li><a href="media_content_metadata_n.htm">Media Content and Metadata</a>
-<p>You can manage and search various media content on the device, such as media files, bookmarks, albums, and playlists. You can also access the MIME type information, and extract and edit the metadata of the media files.</p></li>
+<p>You can manage and search for various media content on the device, such as media files, bookmarks, albums, and playlists. You can also access the MIME type information, and extract and edit the metadata of the media files.</p></li>
<li><a href="image_edit_n.htm">Image Editing</a>
-<p>You can view and process bitmap images in the JPEG format. The processing includes decoding, encoding, converting, and compressing images.</p></li>
+<p>You can view and process bitmap images in JPEG format. The processing includes decoding, encoding, converting, and compressing images.</p></li>
<li><a href="thumbnail_images_n.htm">Thumbnail Images</a>
<li>Streaming playback
<p>Enables you to set specific URLs for <a href="#stream">streaming media playback</a>.</p></li>
<li>Using the WAV player
- <p>Enables you to play audio in the <a href="#wav">wave format</a>.</p></li>
+ <p>Enables you to play audio in the <a href="#wav">WAVE format</a>.</p></li>
<li>Using the tone player
<p>Enables you to play <a href="#tone">tones</a>.</p></li>
</ul>
</ol>
<p>The supported video formats include WMV, ASF, MP4, 3GP, AVI, MKV, and OGG. The available formats depend on the target device.</p>
- <p>In case of a video interruption, the state can be READY due to the resource restriction in the system.</p>
+ <p>In the case of a video interruption, the state can be READY due to the resource restriction in the system.</p>
<p>The following figure illustrates what happens when the player gets interrupted by the system.</p>
<p align="center"><strong>Figure: Player states when interrupted by system</strong></p>
<p>You can set specific URLs for streaming media playback by using the <code>player_set_uri()</code> function.</p>
<p>Both Hypertext Transfer Protocol (HTTP) and Real Time Streaming Protocol (RTSP) protocols support streaming media playback. The HTTP request header supports the playback of both complete and download-in-progress media files. The index table (atoms) must be moved in front of the file for progressive download.</p>
- <p>In case of HTTP streaming, buffering can happen when the player is prepared. You can get the status using the <code>player_set_buffering_cb()</code> function.</p>
+ <p>For HTTP streaming, buffering can happen when the player is prepared. You can get the status using the <code>player_set_buffering_cb()</code> function.</p>
<p>The following table lists the streaming protocol features supported by the player.</p>
<p>The WAV Player API (in <a href="../../../../org.tizen.native.mobile.apireference/group__CAPI__MEDIA__WAV__PLAYER__MODULE.html">mobile</a> and <a href="../../../../org.tizen.native.wearable.apireference/group__CAPI__MEDIA__WAV__PLAYER__MODULE.html">wearable</a> applications) provides controlling functions for using audio resources (media files stored on the device). Use the WAV Player API to enable your application to play audio and control playback. You can use the WAV and OGG audio formats.</p>
- <p>Tizen enables your application to play wave format audio in 1 of 2 ways: </p>
+ <p>Tizen enables your application to play WAVE format audio in 1 of 2 ways: </p>
<ul>
<li>Through the multimedia application control <strong>in mobile applications only</strong>
<p>When using the <a href="../app_management/common_appcontrol_n.htm#multimedia">multimedia application control</a>, the device standard media player application is launched to play audio.</p></li>
<div class="note">
<strong>Note</strong>
- In case of an overlay surface, when the device orientation changes, the displayed video does not rotate automatically. If you want to change the video orientation according to the device orientation, use the <code>player_set_display_rotation()</code> function within the <code>app_device_orientation_cb()</code> callback function used by the application. In case of an Evas surface, the Evas object for the video is rotated by the window manager used by the application, not by the <code>player_set_display_rotation()</code> function.
+ For an overlay surface, when the device orientation changes, the displayed video does not rotate automatically. If you want to change the video orientation according to the device orientation, use the <code>player_set_display_rotation()</code> function within the <code>app_device_orientation_cb()</code> callback function used by the application. For an Evas surface, the Evas object for the video is rotated by the window manager used by the application, not by the <code>player_set_display_rotation()</code> function.
</div>
</li>
<li><p><code>MEDIA_STREAMER_NODE_SINK_TYPE_AUDIO</code></p></li>
</ul>
-<p>The media streamer RTP node is also created in case of a streaming scenario which is responsible for transmitting and receiving data through an IP.</p>
+<p>The media streamer RTP node is also created in a streaming scenario where data is transmitted or received through an IP.</p>
<p>After the nodes are created, they are uploaded into the media streamer pipeline where, in connection with other topology nodes, they construct a logic chain to be launched according to the chosen scenario. The <code>media_streamer_node_add()</code> function is used to add a node to the media streamer.</p>
<p>The use cases in this guide demonstrate how you can use the media streamer functionality to stream video content in the form of Videotestsrc in the broadcast manual mode.</p>
-<p>To launch streaming, you must create a server part media streamer on the 1st device and a client part media streamer on the 2<sup>nd</sup> device. While creating the server part, you must indicate the IP address of the client part in the <code>127.0.0.1</code> format to stream to.</p>
+<p>To launch streaming, you must create a server part media streamer on the first device and a client part media streamer on the second device. While creating the server part, you must indicate the IP address of the client part to stream to, in IPv4 format.</p>
<p align="center"><strong>Figure: Topology scheme of the media streamer Videotestsrc streaming scenario</strong></p>
<p align="center"><img src="../../images/media_streamer_scenario.png" alt="Media streamer scenario" /></p>
</ol>
</li>
<li>Create the encoding format.
-<p>To turn raw video from Videotestsrc or captured video data into encoded video data, an encoder is needed. The conversion of raw video streams (scaling, frame rate conversion, colorspace conversion, and samplerate conversion) is one of the main tasks to conform to the profile output format. The encoding format can be H263 or H264, for example.</p>
+<p>To turn raw video from Videotestsrc or captured video data into encoded video data, an encoder is needed. The conversion of raw video streams (scaling, frame rate conversion, color space conversion, and samplerate conversion) is one of the main tasks to conform to the profile output format. The encoding format can be H263 or H264, for example.</p>
<pre class="prettyprint">
media_format_h vfmt_encoded = NULL;
/* Define encoded video format */
<p align="center"><strong>Figure: Getting metadata</strong></p>
<p align="center"><img src="../../images/metadata.png" alt="Getting metadata" /></p>
- <p>The metadata extractor can be used with video and audio files only. It is not supported in the image files.</p>
+ <p>The metadata extractor can be used with video and audio files only. It is not supported for image files.</p>
</li>
<li>MIME type information
-<p>You can <a href="#get_file_ext">get a MIME type</a> for a file extension and <a href="#get_mime">get a list of extensions</a> associated, for example, with an image or a JPEG MIME type.</p>
+<p>You can <a href="#get_file_ext">get the MIME type</a> for a file extension and <a href="#get_mime">get a list of extensions</a> associated, for example, with an image or the JPEG MIME type.</p>
</li>
</ul>
</li>
<li>
<p>Add artwork to the file using the <code>metadata_editor_append_picture()</code> function.</p>
-<p>As parameters, define the metadata editor handle and the path of the image file that contains the artwork. The image file must be in the JPEG or PNG format. The image is added to the last image file position. You can add multiple image files to the same audio file.</p>
+<p>As parameters, define the metadata editor handle and the path of the image file that contains the artwork. The image file must be in JPEG or PNG format. The image is added to the last image file position. You can add multiple image files to the same audio file.</p>
<pre class="prettyprint">
char *artwork = "append_image.jpg";
<li>
-<p>In case of an audio file, retrieve the artwork from the file using the <code>metadata_extractor_get_artwork()</code> function.</p>
+<p>For an audio file, retrieve the artwork from the file using the <code>metadata_extractor_get_artwork()</code> function.</p>
<p>The retrieved artwork information is available in the 3 out parameters, which define the artwork image, image size, and MIME type.</p>
<li>
-<p>In case of an audio file, retrieve the synchronized lyrics from the file using the <code>metadata_extractor_get_synclyrics()</code> function.</p>
+<p>For an audio file, retrieve the synchronized lyrics from the file using the <code>metadata_extractor_get_synclyrics()</code> function.</p>
<p>The following example code retrieves the synchronized lyrics from index number 1 and prints the time information and lyrics on the screen:</p>
<li>
-<p>In case of a video file, retrieve frames from the file in one of the following ways:</p>
+<p>For a video file, retrieve frames from the file in one of the following ways:</p>
<ul>
<li><p>To retrieve a frame without specifying the time when the frame appears, use the <code>metadata_extractor_get_frame()</code> function.</p></li>
<ul><li>Sources
<p>Sources store various attributes, such as velocity, position, direction, and intensity of the sound, that are used for rendering and have an associated buffer which contains audio data for playback.</p></li>
<li>Buffers
-<p>Buffers store compressed or uncompressed audio data in the PCM format, either 8- or 16-bit, and in the mono or stereo format.</p></li>
+<p>Buffers store compressed or uncompressed audio data in PCM format, either 8- or 16-bit, and in mono or stereo.</p></li>
<li>Single listener
<p>Each audio context has only 1 listener. The listener attributes are used to represent where the user is hearing the audio from.</p></li></ul>
<p>To control the playback, use the following state transition functions:</p>
<ul>
<li><code>alSourcePlay()</code>: Play, replay, or resume a source.</li>
-<li><code>alSourceStop()</code>: Stop one or more sources.</li>
+<li><code>alSourceStop()</code>: Stop 1 or more sources.</li>
<li><code>alSourceRewind()</code>: Rewind a source (set the playback position to the beginning).</li>
<li><code>alSourcePause()</code>: Pause a source.</li></ul>
<h2 id="buffer" name="buffer">Using Buffer Queuing for Stream Playback</h2>
-<p>OpenAL provides a buffer queuing method for the streamed audio source, in which one or more buffers can be queued and dequeued after consumed.</p>
+<p>OpenAL provides a buffer queuing method for the streamed audio source, in which 1 or more buffers can be queued and dequeued after consumed.</p>
<p>To queue and play multiple buffers:</p>
<ol>
<li>
-<p>Submit one or more buffers before starting the playback:</p>
+<p>Submit 1 or more buffers before starting the playback:</p>
<pre class="prettyprint">
#define DATA_CHUNK_SIZE (1024)
</ol>
<h2 id="query_device" name="query_device">Querying Sound Devices</h2>
-<p>The audio behavior of your application must differ in accordance with the various sound devices that are connected.</p>
+<p>The audio behavior of your application must differ depending on the sound devices that are connected.</p>
<p>Use the <code>sound_manager_get_current_device_list()</code> function to get the list handle of the currently connected sound devices. With the sequential search of this device list, you can get the device handle of each device on the list. You can use the <code>sound_manager_get_next_device()</code> and <code>sound_manager_get_prev_device()</code> functions for a sequential search of the device list.</p>
<p>The main features of the Thumbnail Util API include:</p>
<ul><li>Video and image thumbnails
-<p>You can <a href="#get_thumbnail">create thumbnails</a> with video and image files. Audio files are not supported.</p></li>
+<p>You can <a href="#get_thumbnail">create thumbnails</a> from video and image files. Audio files are not supported.</p></li>
<li>Custom size
<p>You can create the thumbnail using any size you like. The Thumbnail Util API outputs the results according to the size you have set. This means that the thumbnail can be generated even if the output size differs from the original aspect ratio.</p></li></ul>
-<p>The requested thumbnail is provided as a raw data type with the BGRA colorspace, not a JPG or PNG file. If you want to save the thumbnail to a file, you must encode it.</p>
+<p>The requested thumbnail is provided as a raw data type with the BGRA color space, not a JPG or PNG file. If you want to save the thumbnail to a file, you must encode it.</p>
<h2 id="prerequisites">Prerequisites</h2>
<p>Call the <code>messages_foreach_message()</code> function to retrieve all existing messages stored in different mailboxes. With the function parameters, you can limit the search results to a subset of all available messages based on:</p>\r
<ul><li>Message box type (inbox, outbox, sent items, drafts, or all of them)</li>\r
<li>Message type (such as SMS or MMS)</li>\r
-<li>Keyword (for search based on text and subject)</li>\r
+<li>Keyword (for search by text or subject)</li>\r
<li>Address (message recipient address)</li></ul>\r
\r
<p>The following example shows a simple search for all SMS messages in all message boxes with a callback function named <code>message_search_callback()</code>.</p>\r
<div id="container"><div id="contents"><div class="content">
<h1>Push</h1>
-<p>Push enables you to push events from an application server to your application on a Tizen device.</p>
+<p>You can to push events from an application server to your application on a Tizen device.</p>
<p>Once your application is successfully registered in the push server through the <a href="#service">push service</a> (daemon) on the device, your application server can send push messages to the application on that particular device.</p>
- <p>When a push message arrives when the application is running, it is automatically delivered to the application. If not, the push service makes a sound or vibrates and adds a ticker or a badge notification to notify the user. By touching this notification, the user can check the message. The application server may send a message with a <code>LAUNCH</code> option. In this case, the push service forcibly launches the application and hands over the message to the application as an <a href="../app_management/app_controls_n.htm">application control</a>.</p>
+ <p>If a push message arrives when the application is running, the message is automatically delivered to the application. If the application is not running, the push service makes a sound or vibrates and adds a ticker or a badge notification to notify the user. By touching this notification, the user can check the message. If the application server sends a message with a <code>LAUNCH</code> option, the push service forcibly launches the application and hands over the message to the application as an <a href="../app_management/app_controls_n.htm">application control</a>.</p>
<p>The main features of the Push API include:</p>
<ul>
<li>Connecting to the push service
}
</pre>
-<p>The <code>_on_state_unregistered()</code> function containing the <code>push_service_register()</code> function is called when the state transits to <code>UNREGISTERED</code>. This sample application is designed to send the registration request as soon as it is connected to the push service. If the application requires users to login to the service, this registration request must be sent after the login process is complete.</p>
+<p>The <code>_on_state_unregistered()</code> function containing the <code>push_service_register()</code> function is called when the state transits to <code>UNREGISTERED</code>. This sample application is designed to send the registration request as soon as it is connected to the push service. If the application requires users to log in to the service, this registration request must be sent after the login process is complete.</p>
<p>The registration request is non-blocking. If the <code>push_service_register()</code> function returns <code>PUSH_SERVICE_ERROR_NONE</code>, the request is successfully delivered to the push service. However, it does not necessarily mean that the request is approved by the server. If the push service successfully sends the request to the server and receives an approval, the <code>_result_cb()</code> callback is called with <code>PUSH_SERVICE_RESULT_SUCCESS</code> as the first parameter:</p>
</li>
<li>Request deregistration.
-<p>When the application no longer wants to receive push notifications, use the following function to request deregistration.</p>
+<p>When the application no longer wants to receive push notifications, use the following function to request deregistration:</p>
<pre class="prettyprint">
push_service_deregister(push_conn, _dereg_result_cb, NULL);
<div class="note">
<strong>Note</strong>
- The <code>push_service_deregister()</code> function is not used, if the application is intended to receive push notifications continuously while it is installed on the device. When the application is uninstalled, the push service detects the event and deregisters the application automatically.
- <p>On the other hand, if the application wants to receive push notifications only when a user logs in, the <code>push_service_deregister()</code> function must be called whenever a user logs out.</p>
+ The <code>push_service_deregister()</code> function is not used if the application is intended to receive push notifications continuously while it is installed on the device. When the application is uninstalled, the push service detects the event and deregisters the application automatically.
+ <p>On the other hand, if the application wants to receive push notifications only when a user logs in, the <code>push_service_deregister()</code> function must be called whenever the user logs out.</p>
</div>
</li>
<ul>
<li>Keep the push application ID confidential.
-<p>If it is exposed, hackers can try to hijack notifications using a fake application with the exposed ID.</p></li>
+<p>If the application ID is exposed, hackers can try to hijack notifications using a fake application with the exposed ID.</p></li>
<li>Do not store the registration ID on the device.
-<p>The registration ID can be seen as a destination address of the notifications. Without the ID, hackers cannot send fake notifications to your application.</p></li>
+<p>The registration ID can be considered as the destination address for notifications. Without the ID, hackers cannot send fake notifications to your application.</p></li>
<li>Encrypt sensitive information.
-<p>When you send sensitive information, such as personal information and financial transactions, encrypt it and load it to the notification as a payload. Do not load the information to the message field of the notification. When the notification arrives at the device, the application decrypts the payload and retrieves the sensitive information.</p></li>
+<p>When you send sensitive information, such as personal information and financial transactions, encrypt it and load it to the notification as a payload instead of the message field. When the notification arrives at the device, the application decrypts the payload and retrieves the sensitive information.</p></li>
<li>Do not hardcode the AppSecret in the source code.
<p>The AppSecret is a key to accessing the push server for sending notifications. If notifications are sent from your application server, the application does not need to know the AppSecret at all. Keep the AppSecret in the server and do not load any related information in the application. If you want device-to-device notification delivery without your application server, the application needs the AppSecret to send a notification from a device. In this case, it is your responsibility to keep the AppSecret safe.</p></li>
</ul>
<p>To send a notification:</p>
<ol>
-<li>Prepare the appID, appSecret, regID, and requestID:
+<li>Prepare the <code>appID</code>, <code>appSecret</code>, <code>regID</code>, and <code>requestID</code>:
<ul>
-<li>The appID and appSecret values are from the email that you received when requesting <a href="#permission">permission to Tizen push servers</a>.</li>
-<li>The regID value is the one that the application server received from your application installed on a Tizen device. Depending on the regID value, the URI of the server to which your application server sends the notification varies.</li>
-<li>The requestID value is used to identify the notification in the push server. When your application server sends notifications using the same requestID value, the last notification overwrites all the previous notifications that are not delivered yet.</li>
+<li>The <code>appID</code> and <code>appSecret</code> values are given in the email message that you received when requesting <a href="#permission">permission to use Tizen push servers</a>.</li>
+<li>The <code>regID</code> value is the one that the application server received from your application installed on a Tizen device. Depending on the <code>regID</code> value, the URI of the server to which your application server sends the notification varies.</li>
+<li>The <code>requestID</code> value is used to identify the notification in the push server. When your application server sends notifications using the same <code>requestID</code> value, the last notification overwrites all the previous notifications that are not delivered yet.</li>
</ul>
</li>
<p>The message field takes effect only when the application is not running (more precisely, when the application is not connected to the push service). If a notification with the above message field arrives at the device where the application is running, the push service delivers the notification directly to the application. It does not show the "Hi" message in the quick panel or increase the badge count.</p>
</li>
-<li>Load your own data to the appData field as a string.
+<li>Load your own data to the <code>appData</code> field as a string.
<p>This use case focuses on how an application developer can construct a notification. For advanced features, see the <a href="push_server_n.htm">Push Server</a> guide for server developers.</p>
</li>
</ol>
<ul>
<li id="receive" name="receive">Receive notifications when the application is running.
-<p>When a notification arrives to the application while it is running (precisely, the application is connected to the service), the <code>_noti_cb()</code> function is called as defined in the <code>push_service_connect()</code> function. In this callback, you can handle the received notification.</p>
+<p>When a notification arrives to the application while it is running (more precisely, while the application is connected to the service), the <code>_noti_cb()</code> callback is called as defined in the <code>push_service_connect()</code> function. You can handle the received notification in the callback.</p>
<p>The following example shows how the application can retrieve the app data (payload), message, and timestamp from the received notification. When the <code>_noti_cb()</code> callback is called, obtain the notification through the first parameter. You can retrieve the app data, message, and time stamp from the handle using the <code>push_service_get_notification_data()</code>, <code>push_service_get_notification_message()</code>, and <code>push_service_get_notification_time()</code> functions respectively. Before exiting the function, free the data, except for the notification itself. The notification is freed automatically right after the callback.</p>
<pre class="prettyprint">
</li>
<li id="recv_noti_app_not_run">Receive notifications when the application is not running.
-<p>If the notification arrives when the application is not running, there are 3 ways to handle the notification:</p>
+<p>If the notification arrives when the application is not running, it can be handled in 3 ways:</p>
<ul>
<li id="force_launch">Forcibly launch the application and deliver the notification to it.
<p>You need to set the action to <code>LAUNCH</code> in the message field when sending the notification from the application server. When the notification action arrives at the device, the push service forcibly launches the application and delivers the notification as a bundle.</p>
<li>Store the notification at the push service database and request it later when the application is launched.
<p>You need to set the action to <code>ALERT</code> or <code>SILENT</code> in the message field when sending the notification from the application server. When such a notification arrives at the device, the push service keeps the notification in the database and waits for the request from the application.</p>
-<p>You can request for unread notifications from the push service. The request can be performed after the connection to the push server when the application is launched.</p>
+<p>You can request for unread notifications from the push service. The request can be performed after connecting to the push server when the application is launched.</p>
<pre class="prettyprint">
if (push_conn) {
int ret = push_service_request_unread_notification(push_conn);
</pre>
<p>The difference between the <code>ALERT</code> and <code>SILENT</code> actions is that the former shows an alert message in the quick panel and changes the badge count, while the latter does not. If the user clicks the alert message in the quick panel, the push service <a href="#force_launch">forcibly launches the application</a> and delivers the notification through the app control callback function.</p></li>
-<li>Discard it.
+<li>Discard the notification.
<p>You need to set the action to <code>DISCARD</code> in the message field when sending the notification from the application server. When such a notification arrives at the device, the push service delivers the notification only when the application is up and running. Otherwise, the push service does not store the notification and discards it.</p></li>
</ul>
</li>
<div id="container"><div id="contents"><div class="content">
<h1>Push Server</h1>
-<p>Push enables you to push events from an application server to your application on a Tizen device. You can also <a href="#decorate_noti">decorate the push notification</a> in the quick panel. If the message sending fails for any reason, an error code identifying the failure reason is returned. You can use the error code to determine how to handle the failure.</p>
+<p>You can push events from an application server to your application on a Tizen device. If the message sending fails for any reason, an error code identifying the failure reason is returned. You can use the <a href="#error_codes">error code</a> to determine how to handle the failure.</p>
<p>The main features of the Push API for the server developers include:</p>
<ul>
<p>You can <a href="#send_server">send push notifications</a> from the application server to an application.</p></li>
<li>Decorating push notifications
<p>You can <a href="#decorate_noti">add decorations to the push notifications</a> in the quick panel.</p></li>
- <li>Handling error codes
- <p>You can <a href="#error_codes">use error codes to identify and handle failures</a>.</p></li>
</ul>
<h2 id="send_server" name="send_server">Sending Push Notifications</h2>
-<p>Using the Tizen Push APIs, you can send notifications to your applications installed on Tizen devices. The basics of sending push notification are covered in the <a href="push_n.htm#send">Sending Push Notifications</a>. This use case covers more advanced information, such as sending multiple notifications in one request and sending multicast notifications.</p>
+<p>You can send notifications to your applications installed on Tizen devices. The basics of sending push notifications are covered in the <a href="push_n.htm#send">Push</a> guide. This use case covers more advanced information, such as sending multiple notifications in one request and sending multicast notifications.</p>
<p>To send push notifications:</p>
{
"messages":
[{
- ...
+ /* Other content */
"message": "action=ALERT&badgeOption=INCREASE&badgeNumber=1&alertMessage=Hi",
"appData": "{id:asdf&passwd:1234}",
- ...
+ /* Other content */
]}
}
</pre>
"action": "backgroundLaunch",
"messages":
[{
- ...
+ /* Other content */
"appData": "{id:asdf&passwd:1234}",
- ...
+ /* Other content */
]}
}
</pre>
<div class="note">
<strong>Note</strong>
- In case of the <code>BACKGROUNDLAUNCH</code> notification, the <code>app_create()</code> and <code>app_control()</code> life-cycle callbacks are called, but the <code>app_resume()</code> callback is not called. However, the next time the user runs the application, the <code>app_resume()</code> callback is invoked normally. For more information on the life-cycle, see the <a href="../../../../org.tizen.guides/html/native/app_management/applications_n.htm">Applications</a> guide.
+ For the <code>BACKGROUNDLAUNCH</code> notification, the <code>app_create()</code> and <code>app_control()</code> life-cycle callbacks are called, but the <code>app_resume()</code> callback is not called. However, the next time the user runs the application, the <code>app_resume()</code> callback is invoked normally. For more information on the life-cycle, see the <a href="../../../../org.tizen.guides/html/native/app_management/applications_n.htm">Applications</a> guide.
</div>
</li>
<p>There are 2 required fields: <code>appID</code> and <code>appSecret</code>.</p>
-<p>The fields are given when you register the application, and they are used for application authentication. If either is missing, the push server rejects the request and returns "3046 – error of application authentication" error. Put these 2 parameters on the request header.</p>
+<p>The fields are given when you register the application, and they are used for application authentication. If either is missing, the push server rejects the request and returns "3045 – error of application authentication" error. Put these 2 parameters on the request header.</p>
</li>
<li>Arguments
</tr>
<tr>
<td><code>expiryDate</code></td>
- <td>Time period, in minutes, for storing the request in the push server if the delivery fails:
+ <td>Time period, in minutes, for storing the request in the push server if the delivery fails:
<ul>
<li>If the value set to 0, the push server stores the request for 1440 minutes (24 hours).</li>
<li>If the value is 1 - 2800, the push server stores the request for that number of minutes.
<div class="note">
<strong>Note</strong>
- In the above example, the 3008 error code means that the regID does not exist in the push server. It happens when your application of that particular regID was uninstalled or disabled by the user, and consequently the regID must be removed from your application server. When the application is reinstalled or enabled, it must repeat the <a href="push_n.htm#registration">registration process</a> and send a new regID to your application server.
+ In the above example, the 3008 error code means that the <code>regID</code> does not exist in the push server. It happens when your application of that particular <code>regID</code> was uninstalled or disabled by the user, and consequently the <code>regID</code> must be removed from your application server. When the application is reinstalled or enabled, it must repeat the <a href="push_n.htm#registration">registration process</a> and send a new <code>regID</code> to your application server.
</div>
</li>
</ul>
<li>Data: JSON </li>
<li>Description: Request a notification push from the push server to the push service</li>
<li>Argument: See the <a href="#single_req">single request</a></li>
-<li>Note: The total request message body must be less than the system default value, 200 kb. If not, "3034 – error of too long chuned message data" is returned. The system default value can be changed as needed.</li>
+<li>Note: The total request message body must be less than the system default value, 200 kb. If not, "3035 – error of too long chuned message data" is returned. The system default value can be changed as needed.</li>
<li>Example header:
<pre class="prettyprint">
appID: 1234567890987654
</li>
<li>Hosting minicontrols
<p>You can host minicontrols, such as lock screens, on your application using the Minicontrol viewer API:</p>
-<ul><li>To host minicontrols, use the <code>minicontrol_viewer_set_event_cb()</code> function for listening to the request from minicontrol providers. </li>
+<ul><li>To host minicontrols, use the <code>minicontrol_viewer_set_event_cb()</code> function to listen for the request from minicontrol providers. </li>
<li>When you get the creation request from a minicontrol provider, use the <code>minicontrol_viewer_add()</code> function to add the minicontrol on your application.</li></ul>
</li>
</ul>
</ul>
<p class="toc-title">Content</p>
<ul class="toc">
- <li><a href="#provider">Account Providers</a></li>
<li><a href="#appcontrol">Account Application Control</a></li>
<li><a href="#prerequisites">Prerequisites</a></li>
<li><a href="#add">Creating and Managing an Account</a></li>
<li><a href="#secret">Managing Account Secrecy</a></li>
<li><a href="#update">Updating Accounts</a></li>
<li><a href="#type">Retrieving Account Types</a></li>
+ <li><a href="#acc_property">Account and Account Provider Properties</a></li>
</ul>
<p class="toc-title">Related Info</p>
<ul class="toc">
<h1>Account Management</h1>
- <p>An account is a collection of information representing the user of a specific provider.</p>
+ <p>An account is a collection of information representing the user of a specific provider. You can manage accounts and their details in your application.</p>
<p>The main features of the Account Manager API include:
</p>
<ul>
<li>Creating and managing accounts
<p>You can <a href="#add">create an account</a>, set its properties, and insert it to the database.</p>
- <p>You can also <a href="#secret">manage the account secrecy level</a> and <a href="#remove">remove accounts</a>.</p>
-
-
- <div class="note">
- <strong>Note</strong>
- To add, update, or remove an account, you must <a href="#provider">register your account provider</a> for all your applications belonging to the same package.
- </div>
- </li>
+ <p>You can also <a href="#secret">manage the account secrecy level</a> and <a href="#remove">remove accounts</a>.</p></li>
<li>Retrieving account information
<p>You can <a href="#get">retrieve information for each existing account</a> and implement a callback function.</p>
<p>You can also get accounts based on a <a href="#retrieve">specific account provider package name</a>, or account providers based on a <a href="#capability">specific capability</a>.</p></li>
<li>Receiving account change notifications</li>
<li>Modifying account properties
- <p>The <code>account.h</code> header file handles account-related information. You can <a href="#queries">query the account details</a> with database queries, <a href="#type">retrieve the account type</a>, and <a href="#update">update the account information</a>.</p>
- <p>The following table lists the account properties that can be modified.</p>
- <p align="center" class="Table"><strong>Table: Account properties</strong></p>
- <table id="account_properties" border="1">
- <tbody>
- <tr>
- <th>Account property</th>
- <th>Data type</th>
- <th>Mandatory</th>
- <th>Description</th>
- </tr>
- <tr>
- <td>User name</td>
- <td><code>String</code></td>
- <td>Yes</td>
- <td>Identity of an account.
- <p>If the display name and email address are not set for an account, the user name is shown for the account on the Accounts screen in the Setting application.</p>
- </td>
- </tr>
- <tr>
- <td>Display name</td>
- <td><code>String</code></td>
- <td>No</td>
- <td>Display name of an account.
- <p>Display name is shown for the account on the Accounts screen in the Setting application.</p>
- </td>
- </tr>
- <tr>
- <td>Email address</td>
- <td><code>String</code></td>
- <td>No</td>
- <td>Email address of an account.
- <p>If the display name is not set for an account, the email address is shown for the account on the Accounts screen in the Setting application.</p>
- </td>
- </tr>
- <tr>
- <td>Package name</td>
- <td><code>String</code></td>
- <td>No</td>
- <td>One of an account package IDs, like the app ID.
- <p>If the package name is not set for an account, the app ID is used as a package name.</p>
- </td>
- </tr>
- <tr>
- <td>Icon path</td>
- <td><code>String</code></td>
- <td>No</td>
- <td>Icon path of an account.
- <p>The icon is shown through the registered icon path as an account icon on the Accounts screen in the Setting application.</p>
- </td>
- </tr>
- <tr>
- <td>Domain name</td>
- <td><code>String</code></td>
- <td>No</td>
- <td>Domain name of an account.
- </td>
- </tr>
- <tr>
- <td>Access token</td>
- <td><code>String</code></td>
- <td>No</td>
- <td>Access token of an account.
- </td>
- </tr>
- <tr>
- <td>Auth type</td>
- <td><code>Integer</code></td>
- <td>No</td>
- <td>Authentication type, such as oauth or xauth.
- </td>
- </tr>
- <tr>
- <td>Capability</td>
- <td>Key-value <code>string</code>-<code>integer</code> pairs</td>
- <td>No</td>
- <td>Capability of an account.
- </td>
- </tr>
- <tr>
- <td>Secret</td>
- <td><code>Integer</code></td>
- <td>No</td>
- <td>The secret value is used to decide whether the account is shown on the Accounts screen in the Setting application.
- </td>
- </tr>
- <tr>
- <td>Sync support</td>
- <td><code>Integer</code></td>
- <td>No</td>
- <td>Current synchronization status.</td>
- </tr>
- <tr>
- <td>Source</td>
- <td><code>String</code></td>
- <td>No</td>
- <td>Source of an account.
- </td>
- </tr>
- <tr>
- <td>User text</td>
- <td><code>String</code></td>
- <td>No</td>
- <td>String array which you can use freely.
- </td>
- </tr>
- <tr>
- <td>User int</td>
- <td><code>Integer</code></td>
- <td>No</td>
- <td>Integer array which you can use freely.
- </td>
- </tr>
- <tr>
- <td>Custom</td>
- <td>Key-value <code>string</code> pairs</td>
- <td>No</td>
- <td>Key-value pairs which you can use freely.
- </td>
- </tr>
- </tbody>
- </table>
-</li> </ul>
-
-
-
-
-<h2 id="provider" name="provider">Account Providers</h2>
- <p>Account providers, such as Google and Facebook, represent specific service provider-related information or protocol that provides the user accounts. To add, update, or remove accounts, you must register a specific account provider in your application.</p>
- <p>To register an account provider, define the account provider information in the <strong>Account</strong> tab of the manifest editor, as described in the following table, and implement the <a href="#appcontrol">account application control</a>.</p>
- <p align="center" class="Table"><strong>Table: Account provider properties</strong></p>
- <table border="1">
- <tbody>
- <tr>
- <th>Account property</th>
- <th>Data type</th>
- <th>Mandatory</th>
- <th>Description</th>
- </tr>
- <tr>
- <td>Multiple accounts support</td>
- <td><code>bool</code> </td>
- <td>Yes</td>
- <td>Indicates whether multiple accounts are supported.</td>
- </tr>
- <tr>
- <td>Icon</td>
- <td><code>String</code></td>
- <td>Yes</td>
- <td>File path of the account provider icon.
- <p>The icon size is:</p>
- <ul>
- <li>72 x 72 for Xhigh (HD)</li>
- <li>48 x 48 for High (WVGA)</li>
- </ul>
- <p>Since the icon is used in <strong>Settings > Accounts</strong>, place the icon in a shared directory.</p></td>
- </tr>
- <tr>
- <td>Small icon</td>
- <td><code>String</code></td>
- <td>Yes</td>
- <td>File path of the account provider icon.
- <p>The icon size is:</p>
- <ul>
- <li>45 x 45 for Xhigh (HD)</li>
- <li>30 x 30 for High (WVGA)</li>
- </ul>
- <p>Since the small icon is used in other applications, place the icon in a shared directory.</p></td>
- </tr>
- <tr>
- <td>Display name</td>
- <td><code>String</code></td>
- <td>Yes</td>
- <td>Display name of the account provider.</td>
- </tr>
- <tr>
- <td>Capabilities</td>
- <td><code>String</code></td>
- <td>No</td>
- <td>Capability of the account provider.
- <p>Capability can be a liaison between an account application and another application. If an account application registers a capability in the manifest file, other applications know that the account application has the capability. And if an account application gives an account a capability, other applications know that the account has the capability.</p>
- <p>Several service-specific capabilities are defined for the Account Manager in Tizen:</p>
+ <p>The <code>account.h</code> header file handles account-related information. You can <a href="#queries">query the account details</a> with database queries, <a href="#type">retrieve the account type</a>, and <a href="#update">update the account information</a>. For a list of modifiable account properties, see <a href="#acc_property">Account and Account Provider Properties</a>.</p>
+</li></ul>
- <ul>
- <li>Contact capability:
- <p><code>ACCOUNT_SUPPORTS_CAPABILITY_CONTACT or "http://tizen.org/account/capability/contact"</code></p>
- <p>If you register this capability in the manifest file, the user using the contact application can see a list of accounts with the account of your service in the contact application.</p>
- </li>
- <li>Calendar capability:
- <p><code>ACCOUNT_SUPPORTS_CAPABILITY_CALENDAR or "http://tizen.org/account/capability/calendar"</code></p>
- <p>If you register this capability in the manifest file, the user using the calendar application can see a list of accounts with the account of your service in the calendar application.</p>
- </li>
- <li>Email capability:
- <p><code>ACCOUNT_SUPPORTS_CAPABILITY_EMAIL or "http://tizen.org/account/capability/email"</code></p>
- </li>
- <li>Photo capability:
- <p><code>ACCOUNT_SUPPORTS_CAPABILITY_PHOTO or "http://tizen.org/account/capability/photo"</code></p>
- </li>
- <li>Video capability:
- <p><code>ACCOUNT_SUPPORTS_CAPABILITY_VIDEO or "http://tizen.org/account/capability/video"</code></p>
- </li>
- <li>Music capability:
- <p><code>ACCOUNT_SUPPORTS_CAPABILITY_MUSIC or "http://tizen.org/account/capability/music"</code></p>
- </li>
- <li>Document capability:
- <p><code>ACCOUNT_SUPPORTS_CAPABILITY_DOCUMENT or "http://tizen.org/account/capability/document"</code></p>
- </li>
- <li>Message capability:
- <p><code>ACCOUNT_SUPPORTS_CAPABILITY_MESSAGE or "http://tizen.org/account/capability/message"</code></p>
- </li>
- <li>Game capability:
- <p><code>ACCOUNT_SUPPORTS_CAPABILITY_GAME or "http://tizen.org/account/capability/game"</code></p>
- </li>
-</ul>
- </td>
- </tr>
- </tbody>
- </table>
-
- <p>If the application has defined the account provider information and implements the appcontrol for the account provider, the account provider is automatically registered when the application is installed.</p>
+ <div class="note">
+ <strong>Note</strong>
+ Account providers, such as Google and Facebook, represent specific service provider-related information or protocol that provides the user accounts. To add, update, or remove an accounts, you must register a specific account provider for all your applications belonging to the same package.
+ <p>To register an account provider, define the <a href="#accprovider_property">account provider information</a> in the <strong>Account</strong> tab of the manifest editor, and implement the <a href="#appcontrol">account application control</a>.</p>
+ <p>If the application has defined the account provider information and implements the appcontrol for the account provider, the account provider is automatically registered when the application is installed.</p>
+ </div>
<h2 id="appcontrol" name="appcontrol">Account Application Control</h2>
<p>The account application control, which allows the user to add and configure accounts, must be implemented in all applications that define an account provider. You are not required to define the application control information in the <strong>Application Control</strong> tab of the manifest editor to <a href="#screen">add the application on the <strong>Account</strong> screen</a>.</p>
</pre>
</li>
-<li>When the account is configured, use the <code>account_insert_to_db()</code> function to insert the account to the account database. Use the account ID as the second parameter (<code>account_id</code>):
+<li>When the account properties are set, use the <code>account_insert_to_db()</code> function to insert the account to the account database. Use the account ID as the second parameter (<code>account_id</code>):
<pre class="prettyprint">
ret = account_insert_to_db(account, &account_id);
<ol>
<li>Prepare sample content.
-<p>To perform queries, you need existing content in the database. To access the existing account, obtain it from the database. This can be done using a few functions, depending on the user requirements.</p>
+<p>To perform queries, you need existing content in the database. To access an existing account, obtain it from the database. This can be done using a few functions, depending on the user requirements.</p>
<p>To create new content to the database:</p>
<ol type="a"><li><p>The <code>Create_Account()</code> function creates a new account from a given <code>account_h</code> handle and account details (name, display name, domain, email). 3 capabilities are added to the account to demonstrate some of the query functions. The capabilities as well as user custom types can be predefined.</p>
</li>
</ol>
+<h2 id="acc_property">Account and Account Provider Properties</h2>
+<p>The following table lists the account properties that can be modified.</p>
+ <p align="center" class="Table"><strong>Table: Account properties</strong></p>
+ <table id="account_properties" border="1">
+ <tbody>
+ <tr>
+ <th>Account property</th>
+ <th>Data type</th>
+ <th>Mandatory</th>
+ <th>Description</th>
+ </tr>
+ <tr>
+ <td>User name</td>
+ <td rowspan="7"><code>String</code></td>
+ <td>Yes</td>
+ <td>Identity of an account.
+ <p>If the display name and email address are not set for an account, the user name is shown for the account on the Accounts screen in the Setting application.</p>
+ </td>
+ </tr>
+ <tr>
+ <td>Display name</td>
+ <td rowspan="14">No</td>
+ <td>Display name of an account.
+ <p>Display name is shown for the account on the Accounts screen in the Setting application.</p>
+ </td>
+ </tr>
+ <tr>
+ <td>Email address</td>
+ <td>Email address of an account.
+ <p>If the display name is not set for an account, the email address is shown for the account on the Accounts screen in the Setting application.</p>
+ </td>
+ </tr>
+ <tr>
+ <td>Package name</td>
+ <td>One of an account package IDs, like the app ID.
+ <p>If the package name is not set for an account, the app ID is used as a package name.</p>
+ </td>
+ </tr>
+ <tr>
+ <td>Icon path</td>
+ <td>Icon path of an account.
+ <p>The icon is shown through the registered icon path as an account icon on the Accounts screen in the Setting application.</p>
+ </td>
+ </tr>
+ <tr>
+ <td>Domain name</td>
+ <td>Domain name of an account.
+ </td>
+ </tr>
+ <tr>
+ <td>Access token</td>
+ <td>Access token of an account.
+ </td>
+ </tr>
+ <tr>
+ <td>Auth type</td>
+ <td><code>Integer</code></td>
+ <td>Authentication type, such as oauth or xauth.
+ </td>
+ </tr>
+ <tr>
+ <td>Capability</td>
+ <td>Key-value <code>string</code>-<code>integer</code> pairs</td>
+ <td>Capability of an account.
+ </td>
+ </tr>
+ <tr>
+ <td>Secret</td>
+ <td rowspan="2"><code>Integer</code></td>
+ <td>The secret value is used to decide whether the account is shown on the Accounts screen in the Setting application.
+ </td>
+ </tr>
+ <tr>
+ <td>Sync support</td>
+ <td>Current synchronization status.</td>
+ </tr>
+ <tr>
+ <td>Source</td>
+ <td rowspan="2"><code>String</code></td>
+ <td>Source of an account.
+ </td>
+ </tr>
+ <tr>
+ <td>User text</td>
+ <td>String array, which you can use freely.
+ </td>
+ </tr>
+ <tr>
+ <td>User int</td>
+ <td><code>Integer</code></td>
+ <td>Integer array, which you can use freely.
+ </td>
+ </tr>
+ <tr>
+ <td>Custom</td>
+ <td>Key-value <code>string</code> pairs</td>
+ <td>Key-value pairs, which you can use freely.
+ </td>
+ </tr>
+ </tbody>
+ </table>
+
+<p>The following table lists the properties that can be defined for each account provider.</p>
+<p align="center" class="Table"><strong>Table: Account provider properties</strong></p>
+ <table id="accprovider_property" border="1">
+ <tbody>
+ <tr>
+ <th>Account property</th>
+ <th>Data type</th>
+ <th>Mandatory</th>
+ <th>Description</th>
+ </tr>
+ <tr>
+ <td>Multiple accounts support</td>
+ <td><code>bool</code> </td>
+ <td rowspan="4">Yes</td>
+ <td>Indicates whether multiple accounts are supported.</td>
+ </tr>
+ <tr>
+ <td>Icon</td>
+ <td rowspan="4"><code>String</code></td>
+ <td>File path of the account provider icon.
+ <p>The icon size is:</p>
+ <ul>
+ <li>72 x 72 for Xhigh (HD)</li>
+ <li>48 x 48 for High (WVGA)</li>
+ </ul>
+ <p>Since the icon is used in <strong>Settings > Accounts</strong>, place the icon in a shared directory.</p></td>
+ </tr>
+ <tr>
+ <td>Small icon</td>
+ <td>File path of the account provider icon.
+ <p>The icon size is:</p>
+ <ul>
+ <li>45 x 45 for Xhigh (HD)</li>
+ <li>30 x 30 for High (WVGA)</li>
+ </ul>
+ <p>Since the small icon is used in other applications, place the icon in a shared directory.</p></td>
+ </tr>
+ <tr>
+ <td>Display name</td>
+ <td>Display name of the account provider.</td>
+ </tr>
+ <tr>
+ <td>Capabilities</td>
+ <td>No</td>
+ <td>Capability of the account provider.
+ <p>Capability can be a liaison between an account application and another application. If an account application registers a capability in the manifest file, other applications know that the account application has the capability. And if an account application gives an account a capability, other applications know that the account has the capability.</p>
+ <p>Several service-specific capabilities are defined for the Account Manager in Tizen:</p>
+
+ <ul>
+ <li>Contact capability:
+ <p><code>ACCOUNT_SUPPORTS_CAPABILITY_CONTACT</code> or <code>"http://tizen.org/account/capability/contact"</code></p>
+ <p>If you register this capability in the manifest file, the user using the contact application can see a list of accounts with the account of your service in the contact application.</p>
+ </li>
+ <li>Calendar capability:
+ <p><code>ACCOUNT_SUPPORTS_CAPABILITY_CALENDAR</code> or <code>"http://tizen.org/account/capability/calendar"</code></p>
+ <p>If you register this capability in the manifest file, the user using the calendar application can see a list of accounts with the account of your service in the calendar application.</p>
+ </li>
+ <li>Email capability:
+ <p><code>ACCOUNT_SUPPORTS_CAPABILITY_EMAIL</code> or <code>"http://tizen.org/account/capability/email"</code></p>
+ </li>
+ <li>Photo capability:
+ <p><code>ACCOUNT_SUPPORTS_CAPABILITY_PHOTO</code> or <code>"http://tizen.org/account/capability/photo"</code></p>
+ </li>
+ <li>Video capability:
+ <p><code>ACCOUNT_SUPPORTS_CAPABILITY_VIDEO</code> or <code>"http://tizen.org/account/capability/video"</code></p>
+ </li>
+ <li>Music capability:
+ <p><code>ACCOUNT_SUPPORTS_CAPABILITY_MUSIC</code> or <code>"http://tizen.org/account/capability/music"</code></p>
+ </li>
+ <li>Document capability:
+ <p><code>ACCOUNT_SUPPORTS_CAPABILITY_DOCUMENT</code> or <code>"http://tizen.org/account/capability/document"</code></p>
+ </li>
+ <li>Message capability:
+ <p><code>ACCOUNT_SUPPORTS_CAPABILITY_MESSAGE</code> or <code>"http://tizen.org/account/capability/message"</code></p>
+ </li>
+ <li>Game capability:
+ <p><code>ACCOUNT_SUPPORTS_CAPABILITY_GAME</code> or <code>"http://tizen.org/account/capability/game"</code></p>
+ </li>
+</ul>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+
<script type="text/javascript" src="../../scripts/jquery.zclip.min.js"></script>
<script type="text/javascript" src="../../scripts/showhide.js"></script>
</div></div></div>
<p>In the <code>calendar_db_get_all_records()</code> function, you need as parameters the URI of the view to get records from, the index from which results are received, the maximum number of results, and the record list.</p>
<h2 id="event" name="event">Event Instances and Reminders</h2>
-<p>An event record describes various properties, such as description, categories, and priority. It also contains information on when the event takes place. In a recurring event, there are more than 1 instance of the event. Each instance has its corresponding instance record.</p>
+<p>An event record describes various properties, such as description, categories, and priority. It also contains information on when the event takes place. In a recurring event, there are more than 1 instances of the event. Each instance has its corresponding instance record.</p>
<p>If an event is inserted with rrule (recurrence rule), alarm, and attendee, its data is saved to each relevant database. Generated instances based on the rrule are also stored in the instance database.</p>
<p align="center"><strong>Figure: Views and databases for event instances</strong></p>
</li>
<li id="proj" name="proj">Projection querying
-<p>A projection allows you to query the data for just those specific properties of a record that you actually need, at lower latency and cost than retrieving the entire set of properties.</p>
+<p>A projection allows you to query the data for only those specific properties of a record that you actually need, at lower latency and cost than retrieving the entire set of properties.</p>
<p>The following example code creates a filter that gets only the event ID, summary, and start time from the records with the "test" (string filter) in their summary. Create a query, and add a filter to it; the results are received in a list.</p>
<h2 id="vcal" name="vcal">vCalendar</h2>
<p>Use the vCalendar to exchange personal calendar and schedule information.</p>
-<p>vCalendar supports versions 1.0 (vcs) and 2.0 (ics). vCalendar version 2.0 is known as iCalendar. For more information about vCalendar, see <a href="http://www.ietf.org/rfc/rfc2445.txt" target="blank">rfc2445</a>.</p>
+<p>vCalendar supports versions 1.0 (vcs) and 2.0 (ics). vCalendar version 2.0 is known as iCalendar. For more information on vCalendar, see <a href="http://www.ietf.org/rfc/rfc2445.txt" target="blank">rfc2445</a>.</p>
<p>The following snippet shows an example of the vCalendar:</p>
<pre class="prettyprint">
BEGIN:VCALENDAR
<p>To use the vCalendar:</p>
<ul>
<li>
-<p>You can use the calendar service to <a href="#make">compose a vCalendar stream</a>. With the stream, it is possible to transmit data in the JSON format.</p>
+<p>You can use the calendar service to <a href="#make">compose a vCalendar stream</a>. With the stream, it is possible to transmit data in JSON format.</p>
<pre class="prettyprint">
calendar_list_h list = NULL;
/* Create or get list to make a vcalendar stream */
<p>You can also create <a href="#list">lists</a> of similar contacts to manage them in <a href="#bulk">batches</a>.</p></li>
<li>You can <a href="#create_contact">insert contacts</a> to, <a href="#update_contact">update them</a> in, and remove them from the contacts database.</li>
<li>You can monitor <a href="#db">changes in the contacts database</a>.</li>
- <li>You can search and organize contacts using <a href="#filter">filters and queries</a>.</li>
+ <li>You can search for and organize contacts using <a href="#filter">filters and queries</a>.</li>
<li>You can <a href="#settings">manage the display and sorting order settings</a> for contacts.</li>
<li>You can manage My profile. It has similar details as contact information in general, but no properties, such as group relation, ringtone, and message alert. My profile can have a single entry in each address book.</li>
<li>You can store social activities.</li>
<ul><li>You can <a href="#pl_create">create and store call or message logs</a>.</li>
<li>You can <a href="#pl_delete">delete logs</a>.</li></ul></li></ul>
- <p>The contact service supports <a href="#vcard">vCards</a>, allowing you to import contact information from a vCard or export it to a vCard format. You can also <a href="#sim">import contacts from the device SIM card</a> to the contacts database.</p>
+ <p>The contact service supports <a href="#vcard">vCards</a>, allowing you to import contact information from a vCard or export it to vCard format. You can also <a href="#sim">import contacts from the device SIM card</a> to the contacts database.</p>
<p>The following figure illustrates the different entities and their relationships in the contact service.</p>
<p align="center"><strong>Figure: Child records</strong></p>
<p align="center"><img alt="Child records" src="../../images/contacts_children.png" /></p>
-<p>The following code example inserts an address record into a contact record. Note that it is not necessary to insert or destroy all records - just the parent record needs to be inserted into the database to store all the information, and when the parent record is destroyed, the child records are also destroyed automatically.</p>
+<p>The following code example inserts an address record into a contact record. Note that it is not necessary to insert or destroy all records. Only the parent record needs to be inserted into the database to store all the information, and when the parent record is destroyed, the child records are also destroyed automatically.</p>
<pre class="prettyprint">
contacts_record_h address = NULL;
<p>Some contact properties are defined as child records that are associated with the parent record. For a detailed list of the contact properties, see the <code>_contacts_contact</code> view description in the Contacts API (in <a href="../../../../org.tizen.native.mobile.apireference/group__CAPI__SOCIAL__CONTACTS__SVC__VIEW__MODULE.html#CAPI_SOCIAL_CONTACTS_SVC_VIEW_MODULE_contacts_contact">mobile</a> and <a href="../../../../org.tizen.native.wearable.apireference/group__CAPI__SOCIAL__CONTACTS__SVC__VIEW__MODULE.html#CAPI_SOCIAL_CONTACTS_SVC_VIEW_MODULE_contacts_contact">wearable</a> applications). If the property type is <code>record</code>, the property is defined as a child record. The property description defines whether a single or multiple child records are allowed for a specific property.</p>
-<p>When you create a new contact, the system automatically creates a new person associated with that contact. A person is an aggregation of one or more contacts associated with the same individual. A contact is always associated with a person.</p>
+<p>When you create a new contact, the system automatically creates a new person associated with that contact. A person is an aggregation of 1 or more contacts associated with the same individual. A contact is always associated with a person.</p>
<p>To create a new contact:</p>
</li>
<li>
<p>Set a projection to the query using the <code>contacts_query_set_projection()</code> function.</p>
-<p>A projection allows you to query the data for specific properties of a record. Using a projection can reduce latency in case of a large database.</p>
+<p>A projection allows you to query the data for specific properties of a record. Using a projection can reduce latency when querying a large database.</p>
<p>The following example limits the properties from the previous steps to the first and last name:</p>
<pre class="prettyprint">
unsigned my_projection[] = {_contacts_name.contact_id, _contacts_name.first, _contacts_name.last}
</li>
<li>
-<p>Loop through the contact list, export each contact record in the vCard format, and write the record to the file:</p>
+<p>Loop through the contact list, export each contact record in vCard format, and write the record to the file:</p>
<ul>
<li><p>To export a contact from the <code>_contacts_contact</code> view, use the <code>contacts_vcard_make_from_contact()</code> function.</p></li>
<li><p>To export details from the <code>_contacts_person</code> view, use the <code>contacts_vcard_make_from_person()</code> function.</p></li>
<h2 id="filters" name="filters">Filters and Attributes</h2>
-<p>Regarding each history data type, one or more filters can be set to specify the necessary statistics. For example, applications can get information about the 3 most frequently used applications from the last 30 days while a headphone is connected by setting the filters of the result size, time span, and the audio jack status. The supported filters for the history data types are summarized in the following table.</p>
+<p>Regarding each history data type, 1 or more filters can be set to specify the necessary statistics. For example, applications can get information about the 3 most frequently used applications from the last 30 days while a headphone is connected by setting the filters of the result size, time span, and the audio jack status. The supported filters for the history data types are summarized in the following table.</p>
<p align="center" class="Table"><strong>Table: Supported filters for history data</strong></p>
<table>
<h2 id="fido_uaf_components" name="fido_uaf_components">FIDO UAF Components</h2>
<p>UAF (Universal Authentication Framework) authenticators can be connected to a user device using various physical interfaces, such as SPI, USB, and Bluetooth. The UAF Authenticator-Specific Module (ASM) is a software interface on top of UAF authenticators, which gives a standardized way for the FIDO UAF clients to <a href="#find_auth">detect and access the functionality of UAF authenticators</a>, and hides the internal communication complexity from the clients.</p>
- <p>The ASM is a platform-specific software component offering an API to FIDO UAF clients, enabling them to discover and communicate with one or more available authenticators. A single ASM can report on behalf of multiple authenticators.</p>
+ <p>The ASM is a platform-specific software component offering an API to FIDO UAF clients, enabling them to discover and communicate with 1 or more available authenticators. A single ASM can report on behalf of multiple authenticators.</p>
<p>The FIDO UAF protocol and its various operations are described in the <a href="https://fidoalliance.org/specs/fido-uaf-v1.0-ps-20141208/fido-uaf-protocol-v1.0-ps-20141208.html" target="_blank">FIDO UAF Protocol Specification</a>. The following figure shows a simplified architecture diagram of the interactions and actors.</p>
<p align="center"><strong>Figure: UAF high level architecture</strong></p>
<p style="text-align: center;"> <img alt="UAF High Level Architecture" src="../../images/fido_uaf_high_level_architecture.png" /></p>
<ol>
<li>Register an authenticator.
-<p>UAF allows the relying party to register a FIDO authenticator with the user account at the relying party. The relying party can specify a policy for supporting various FIDO authenticator types. A FIDO UAF client only registers existing authenticators in accordance with that policy.</p>
+<p>UAF allows the relying party to register a FIDO authenticator with the user account at the relying party. The relying party can specify a policy for supporting various FIDO authenticator types. A FIDO UAF client only registers existing authenticators that conform to that policy.</p>
<pre class="prettyprint">
void
ret = oauth2_request_create(&request);
</pre>
</li>
-<li>Set the parameters needed for making an OAuth 2.0 request.
+<li>Set the parameters needed for making the request.
<p>You can set various request properties, such as end points for authentication and token, grant type, user name, and password.</p>
<pre class="prettyprint">
<li id="direct_token">Request the access token directly.
-<p>You can request an access token in a single step without obtaining the authorization code explicitly. The code is obtained after the authentication and passed to the server to obtain the access token internally in case of the authorization code grant type. In case of the implicit, resource owner password credentials, and client credentials grant types, you can obtain the access token directly.</p>
+<p>You can request an access token in a single step without obtaining the authorization code explicitly. For the authorization code grant type, the code is obtained after authentication and passed to the server to obtain the access token internally. For implicit, resource owner password credentials, and client credentials grant types, you can obtain the access token directly.</p>
<p>To obtain the access token directly, use the <code>oauth2_manager_request_token()</code> function. The response from the server is included in the callback.</p>
</ul></li>
<li>Refresh the access token.
<p>Refresh tokens are credentials used to obtain access tokens. Refresh tokens are issued to the client by the authorization server and are used to obtain a new access token when the current access token becomes invalid or expires, or to obtain additional access tokens with an identical or narrower scope.</p>
-<p>Use the <code>oauth2_manager_refresh_access_token()</code> function to refresh an access token. The response from the server is included in the callback.</p>
+<p>To refresh an access token, use the <code>oauth2_manager_refresh_access_token()</code> function. The response from the server is included in the callback.</p>
<pre class="prettyprint">
void
oauth2_error_get_custom_data(e_handle, "error", &error_val);
</pre>
</li>
-<li>When you no longer need the it, free the response handle with the <code>oauth2_response_destroy()</code> function:
+<li>When you no longer need it, free the response handle with the <code>oauth2_response_destroy()</code> function:
<pre class="prettyprint">
ret = oauth2_response_destroy(response);
<p>In that case, the key manager provides secure cryptographic operations for non-exportable keys without revealing key values to clients.</p></li></ul>
<p>All of the data in the key manager is protected by an internal key. In addition, a client can encrypt its data using its own password. If a client provides a password when storing data, the data is encrypted with that password. To obtain the data from the key manager later, the same password must be provided. The additional password provides protection in case the device is lost.</p>
<p>When storing data:</p>
-<ul><li>For small-size sensitive data, store it within the key manager.</li>
-<li>For large-size sensitive data, store it as a local file and encrypt it with a key stored within the key manager.</li>
+<ul><li>For small amounts of sensitive data, store the data within the key manager.</li>
+<li>For large amounts of sensitive data, store the data as a local file and encrypt it with a key stored within the key manager.</li>
<li>For very sensitive data, supply an additional password.</li>
<li>For keys, tag them as non-exportable when storing them.</li></ul>
</li>
<h3>Privacy-related Privileges</h3>
<p>Some privileges are related to the user privacy and sensitive data (such as contact, calendar, message, and camera).</p>
-<p>Because these privileges are used to access very sensitive user data, when an application tries to use them, the system opens a popup window to ask the user whether they allow the data to be accessed. The user can enable and disable those privileges for specific applications in the device <strong>Settings</strong> menu.</p>
+<p>Because these privileges are used to access very sensitive user data, when an application tries to use them, the system opens a popup window to ask the user whether they allow the data to be accessed. The user can enable and disable those privileges for specific applications from the device <strong>Settings</strong> menu.</p>
<h2 id="communication">Communicating Securely Between Applications</h2>
<p>Tizen supports APIs for communicating between application processes. You can use various methods when developing your Tizen application to ensure secure communication: file sharing, message ports, and data control.</p>
<p align="center"><strong>Figure: Voice command hints on the screen</strong></p>
<p align="center"><img alt="Voice command hints on the screen" src="../../images/voice_control_elm_screen.png" /></p>
-<p>You have no need to consider how to recognize voice commands or start and stop the recognition process. A preloaded voice application handles the process automatically. You just need to set the command and hint on every EFL elementary component on which you want to use the voice command.</p>
+<p>You have no need to consider how to recognize voice commands or start and stop the recognition process. A preloaded voice application handles the process automatically. You simply need to set the command and hint on every EFL Elementary component on which you want to enable voice commands.</p>
-<p>When the user speaks a command corresponding to a visible EFL elementary component on the screen, the recognized command is sent to the Voice control elementary library from the Voice control service, and the action mapped to the component is executed. For example, if the component is a button, the action can be a button click.</p>
+<p>When the user speaks a command corresponding to a visible EFL Elementary component on the screen, the recognized command is sent to the Voice control elementary library from the Voice control service, and the action mapped to the component is executed. For example, if the component is a button, the action can be a button click.</p>
<p align="center"><strong>Figure: Voice command process</strong></p>
<div class="note">
<strong>Note</strong>
- The detailed implementation of the preloaded voice application (how to trigger and recognize the user speaking) can differ according to the device (mobile, wearable, or TV).
+ The detailed implementation of the preloaded voice application (how to trigger and recognize the user speaking) can vary according to the device (mobile, wearable, or TV).
</div>
<div class="note">
<strong>Note</strong>
- Set the commands and hints on visible EFL elementary UI components only. When the visible components on the screen change, the commands and hints must also change.
+ Set the commands and hints on visible EFL Elementary UI components only. When the visible components on the screen change, the commands and hints must also change.
</div>
<h2 id="prerequisites">Prerequisites</h2>
<h1>Actors</h1>
<p>An actor is the basic component that composes the entire scene. It can have visible (for example, UI components) or invisible (for example, a camera actor or layer) forms.</p>
-<p>Actor is also the primary object with which DALi applications interact. Multiple types of event signals provided by actors can be handled in a application through user-defined callback functions.</p>
+<p>An actor is also the primary object with which DALi applications interact. Multiple types of event signals provided by actors can be handled in an application through user-defined callback functions.</p>
<p>For additional actor usage examples, see <a href="layout_n.htm#example">Actor Layout Examples</a>.</p>
<p align="center"><strong>Figure: Actor types</strong></p>
<p align="center"><img alt="Actor types" src="../../../images/actor_types.png"/></p>
-<p>Actor has the following concrete types:</p>
+<p>An actor has the following concrete types:</p>
<ul>
<li><strong>UI Components</strong> are used to organize the application appearance. For more information, see <a href="ui_components_n.htm">UI Components</a>.</li>
<h2 id="position" name="position">Positioning Actors</h2>
-<p>An actor inherits its parent's position. The relative position between the actor & parent is determined by the following properties:</p>
+<p>An actor inherits its parent's position. The relative position between the actor and parent is determined by the following properties:</p>
<ul>
<li><strong>Parent origin</strong>
<p>This Vector3 property defines a point within the parent actor's area.</p>
<p align="center"><strong>Figure: CheckBoxButton</strong></p>
<p align="center"><img alt="CheckBoxButton" src="../../../images/checkbox_button.png"/></p>
-<p>A checkbox button emits all 4 button input signals, but usually you can just use the <code>Button::StateChangedSignal()</code> signal to be notified when the button changes its state to selected or unselected. The following code shows an example of a basic checkbox button:</p>
+<p>A checkbox button emits all 4 button input signals, but often you can simply use the <code>Button::StateChangedSignal()</code> signal to be notified when the button changes its state to selected or unselected. The following code shows an example of a basic checkbox button:</p>
<pre class="prettyprint">
// This sample code is for the HelloWorldExample class
<td>Use either <code>ParentOrigin</code> and <code>AnchorPoint</code> settings, or the <code>Dali::Toolkit::TableView</code> class (in <a href="../../../../../org.tizen.native.mobile.apireference/classDali_1_1Toolkit_1_1TableView.html">mobile</a> and <a href="../../../../../org.tizen.native.wearable.apireference/classDali_1_1Toolkit_1_1TableView.html">wearable</a> applications).</td>
</tr>
<tr>
- <td>Need to automatically modify the position property of one actor based on the position property of another actor that is neither a parent or a child.</td>
+ <td>Need to automatically modify the position property of one actor based on the position property of another actor that is neither a parent nor a child.</td>
<td>Use a constraint.</td>
</tr>
<tr>
</li>
<li>Run the DALi application:
-<p>To run your application, select <strong>Run > Run</strong> or press <strong>Ctrl+F11</strong> in the Tizen Studio.</p>
+<p>To run your application, select <strong>Run > Run</strong> or press <strong>Ctrl + F11</strong> in the Tizen Studio.</p>
<p>For more information, see <a href="../../../../../org.tizen.training/html/native/process/running_app_n.htm">Running Applications</a>.</p>
</li></ol>
</ul>
<p class="toc-title">Content</p>
<ul class="toc">
- <li><a href="#touch">Touch Data</a></li>
+ <li><a href="#touch">Touch Events</a></li>
<li><a href="#key">Key Events</a></li>
<li><a href="#input">Input Signals</a></li>
<li><a href="#gesture">Gestures</a></li>
<h1>Event Handling</h1>
-<p>DALi event handling system is composed of 2 major concepts:</p>
+<p>The DALi event handling system is composed of 2 major concepts:</p>
<ul>
<li>Signal
-<p>Notifications containing event information emitted by GUI components. Also known as events or notifications.</p></li>
+<p>Notifications that contain event information emitted by GUI components.</p></li>
<li>Slot
-<p>Special functions receiving signals. Also known as event handlers, observer, listener, or callbacks.</p></li>
+<p>Special functions that receive signals. Also known as event handlers, observers, listeners, or callbacks.</p></li>
</ul>
<p>DALi emits various types of signals to an application to inform it of user actions and the application can handle them through slots.</p>
<li>Many-to-many relationship: 1 slot can connect to many signals and 1 signal can be connected to many slots, for example</li>
</ul>
-<h2 id="touch" name="touch">Touch Data</h2>
+<h2 id="touch" name="touch">Touch Events</h2>
<p>The <code>Dali::Actor</code> class (in <a href="../../../../../org.tizen.native.mobile.apireference/classDali_1_1Actor.html">mobile</a> and <a href="../../../../../org.tizen.native.wearable.apireference/classDali_1_1Actor.html">wearable</a> applications) provides the <code>TouchSignal()</code> function to inform the application that a user touches the actor. It is defined as follows:</p>
<pre class="prettyprint">
</tr>
<tr>
<td><code>KeyInputFocusLostSignal()</code></td>
- <td>Emitted when the control loses key input focus, which can be due to it being gained by another control or actor or just cleared from this control as no longer required.
+ <td>Emitted when the control loses key input focus, which can be due to it being gained by another control or actor or simply cleared from this control as no longer required.
<p>Callback: <code>bool YourCallbackName( Control control );</code></p></td>
</tr>
<tr>
<li><code>Dali::LongPressGestureDetector</code> (in <a href="../../../../../org.tizen.native.mobile.apireference/classDali_1_1LongPressGestureDetector.html">mobile</a> and <a href="../../../../../org.tizen.native.wearable.apireference/classDali_1_1LongPressGestureDetector.html">wearable</a> applications) detects when the user does a long-press action.</li>
<li><code>Dali::TapGestureDetector</code> (in <a href="../../../../../org.tizen.native.mobile.apireference/classDali_1_1TapGestureDetector.html">mobile</a> and <a href="../../../../../org.tizen.native.wearable.apireference/classDali_1_1TapGestureDetector.html">wearable</a> applications) detects when the user does a tap action.</li>
<li><code>Dali::PinchGestureDetector</code> (in <a href="../../../../../org.tizen.native.mobile.apireference/classDali_1_1PinchGestureDetector.html">mobile</a> and <a href="../../../../../org.tizen.native.wearable.apireference/classDali_1_1PinchGestureDetector.html">wearable</a> applications) detects when the user moves 2 fingers towards or away from each other.</li>
-<li><code>Dali::PanGestureDetector</code> (in <a href="../../../../../org.tizen.native.mobile.apireference/classDali_1_1PanGestureDetector.html">mobile</a> and <a href="../../../../../org.tizen.native.wearable.apireference/classDali_1_1PanGestureDetector.html">wearable</a> applications) detects when the user moves one or more fingers in the same direction.</li>
+<li><code>Dali::PanGestureDetector</code> (in <a href="../../../../../org.tizen.native.mobile.apireference/classDali_1_1PanGestureDetector.html">mobile</a> and <a href="../../../../../org.tizen.native.wearable.apireference/classDali_1_1PanGestureDetector.html">wearable</a> applications) detects when the user moves 1 or more fingers in the same direction.</li>
</ul>
<p>The following example shows how an application can be notified of a pan gesture:</p>
<h2 id="automatic" name="automatic">Automatic Connection Management</h2>
-<p>If you have a pair of a connected signal (for example, a button clicked signal) and a slot (for example, a toolbar object having the callback for the signal), and one of them (the button or the toolbar) is deleted without any notification, the application crashes when the signal is emitted or the slot tries to disconnect the signal.</p>
+<p>If you have a pair made up of a connected signal (for example, a button clicked signal) and a slot (for example, a toolbar object having the callback for the signal), and one of them (the button or the toolbar) is deleted without any notification, the application crashes when the signal is emitted or the slot tries to disconnect the signal.</p>
<p>DALi provides the automatic connection management mechanism to prevent this kind of situation. The key is the <code>Dali::ConnectionTracker</code> class (in <a href="../../../../../org.tizen.native.mobile.apireference/classDali_1_1ConnectionTracker.html">mobile</a> and <a href="../../../../../org.tizen.native.wearable.apireference/classDali_1_1ConnectionTracker.html">wearable</a> applications). It tracks connections between signals and slots, and performs an automatic disconnection when either the signal or slot is deleted.</p>
<p>DALi provides rule-based layout management (size negotiation), which is used to allocate the actor sizes on the stage based on the dependency rules between the actors.</p>
<h2 id="dimension" name="dimension">Dimensions</h2>
-<p>The notion of width and height is generalized into a concept of a dimension. Several functions take the <code>Dimension</code> parameter. The <code>Dali::Dimension::Type</code> enum (in <a href="../../../../../org.tizen.native.mobile.apireference/namespaceDali_1_1Dimension.html#a4e123928ac3109e971b70874653d1b8b">mobile</a> and <a href="../../../../../org.tizen.native.wearable.apireference/namespaceDali_1_1Dimension.html#a4e123928ac3109e971b70874653d1b8b">wearable</a> applications) specifies the available dimensions as bit fields:</p>
+<p>The notions of width and height are generalized into the concept of a dimension. Several functions take the <code>Dimension</code> parameter. The <code>Dali::Dimension::Type</code> enum (in <a href="../../../../../org.tizen.native.mobile.apireference/namespaceDali_1_1Dimension.html#a4e123928ac3109e971b70874653d1b8b">mobile</a> and <a href="../../../../../org.tizen.native.wearable.apireference/namespaceDali_1_1Dimension.html#a4e123928ac3109e971b70874653d1b8b">wearable</a> applications) specifies the available dimensions as bit fields:</p>
<ul>
<li><code>Dimension::WIDTH</code></li>
<li><code>Dimension::HEIGHT</code></li>
<p>The <code>Dali::Toolkit::Model3dView</code> is a control for displaying static 3D content. It is capable of reading <code>.obj</code> and <code>.mtl</code> files, and up to 3 textures, with a single light and 3 simple illumination types.</p>
-<p>The OBJ or <code>.obj</code> (object) file is a geometry definition file format and the MTL or <code>.mtl</code> (material) file contains one or more material definitions, each of which includes the color, texture, and reflection map of individual materials.</p>
+<p>The OBJ or <code>.obj</code> (object) file is a geometry definition file format and the MTL or <code>.mtl</code> (material) file contains 1 or more material definitions, each of which includes the color, texture, and reflection map of individual materials.</p>
<p>The <code>Model3dView</code> control automatically scales the loaded geometry to fit within its size boundary.</p>
<h2 id="model">Specifying the Illumination Model</h2>
-<p>Illumination models are used to calculate the intensity of light that is reflected at a given point on a surface. The diffuse reflection is the reflection of light from a surface such that an incident ray is reflected at many angles rather than at just one angle as in the case of specular reflection.</p>
+<p>Illumination models are used to calculate the intensity of light that is reflected at a given point on a surface. The diffuse reflection is the reflection of light from a surface such that an incident ray is reflected at many angles rather than at only one angle, as in specular reflection.</p>
<p>The following table illustrates the available illumination models.</p>
</li>
<li>You can style particular controls or sub-groups of controls by specifying their style name programmatically.</li>
<li>Styles can be inherited and tweaked, so you can create minor updates to existing styles with very little code.</li>
-<li>The platform can change the default system font family and logical size. This is handled by the default stylesheets, but it is possible to override this behavior in your own stylesheets. You can also listen to the style manager's <code>StyleChangedSignal()</code> in order to determine when the platform style has changed.</li>
+<li>The platform can change the default system font family and logical size. This is handled by the default stylesheets, but it is possible to override this behavior in your own stylesheets. You can also listen for the style manager's <code>StyleChangedSignal()</code> in order to determine when the platform style has changed.</li>
</ul>
<h2 id="stylesheet">Stylesheet Loading</h2>
</li>
<li>Applying a style to your own control instances
-<p>If you require finer-grained control of styling, for example, for particular labels in your application, you can use an alternative style. Set the style name of these instances after they are created:</p>
+<p>If you require finer-grained control of styling, such as for particular labels in your application, you can use an alternative style. Set the style name of these instances after they are created:</p>
<pre class="prettyprint">
TextLabel label = TextLabel::New( myLabelText );
}
</pre>
-<p>As well as HTML codes, you can use device-specific strings, or you can also use the object format with separately specified RGB components (and optional alpha component):</p>
+<p>As well as HTML code, you can use device-specific strings, or you can also use the object format with separately specified RGB components (and optional alpha component):</p>
<pre class="prettyprint">
{
<div id="container"><div id="contents"><div class="content">
<h1>SVG Rendering</h1>
-<p>SVG (Scalable Vector Graphics) defines vector-based graphics in the XML format. The SVG graphics do not lose any quality when they are zoomed or resized.</p>
+<p>SVG (Scalable Vector Graphics) defines vector-based graphics in XML format. SVG graphics do not lose any quality when they are zoomed or resized.</p>
<p>Dali SVG rendering covers the following core features:</p>
<tr>
<td><code>TEXT</code></td>
<td><code>String</code></td>
- <td>Text to display in the UTF-8 format</td>
+ <td>Text to display, in UTF-8 encoding</td>
</tr>
<tr>
<td><code>TEXT_COLOR</code></td>
<li><strong>Screen reader</strong>
<p>Visually-impaired users can interact with a Tizen device through intuitive touch screen gestures. The screen reader reacts to the gestures by examining the elements of the graphical user interface, reading aloud, and highlighting the currently focused content of the screen.</p></li></ul>
-<p>You can enable one or more accessibility features at the same time to better suit the device to your needs and preferences. Some features (such as the screen reader) require the use of a small set of specific gestures to operate them, while others (such as changing font size) only need to be enabled in the device settings.</p>
+<p>You can enable 1 or more accessibility features at the same time to better suit the device to your needs and preferences. Some features (such as the screen reader) require the use of a small set of specific gestures to operate them, while others (such as changing font size) only need to be enabled in the device settings.</p>
<h2 id="screen_reader" name="screen_reader">Enabling the Screen Reader</h2>
</li>
<li>
<p>Minimalism</p>
-<p>Overloading the screen with lots of elements is undesirable both in terms of accessibility and usability in general. Users with physical disabilities or poor vision can find it difficult to operate very small components, while those with developmental or attention disabilities can feel overwhelmed by a complex layout. Even non-disabled users can be confused by a component-packed screen and have difficulty navigating through it, especially when operating the device on the go or using just one hand.</p>
+<p>Overloading the screen with lots of elements is undesirable both in terms of accessibility and usability in general. Users with physical disabilities or poor vision can find it difficult to operate very small components, while those with developmental or attention disabilities can feel overwhelmed by a complex layout. Even non-disabled users can be confused by a component-packed screen and have difficulty navigating through it, especially when operating the device on the go or using only one hand.</p>
</li>
<li>
<p>No flickering or blinking content</p>
<ul>
<li>Label:
-<p>The label on the component is, for example, <strong>Ok</strong> or <strong>Cancel</strong> (in case of a button). The label maps to the <code>name</code> property of the AT-SPI2 object and is equivalent to the result of the <code>elm_object_text_get()</code> function. The property can be also overwritten using the <code>elm_atspi_accessible_name_set()</code> function.</p>
+<p>The label on the component. For example, <strong>Ok</strong> or <strong>Cancel</strong> (for a button). The label maps to the <code>name</code> property of the AT-SPI2 object and is equivalent to the result of the <code>elm_object_text_get()</code> function. The property can be also overwritten using the <code>elm_atspi_accessible_name_set()</code> function.</p>
</li>
<li>Traits:
-<p>The traits are the component type or role, for example, <code>"Button"</code> (in case of a button). The trait maps to the <code>role</code> property of the AT-SPI2 object.</p>
+<p>The component type or role. For example, <code>"Button"</code> (for a button). The trait maps to the <code>role</code> property of the AT-SPI2 object.</p>
</li>
<li>State:
-<p>The value or status of the component is, for example, <code>"Disabled"</code> (in case of a disabled button).</p>
+<p>The value or status of the component. For example, <code>"Disabled"</code> (for a disabled button).</p>
</li>
<li>Description (optional attribute):
-<p>The hint or guide to explain the component is, for example, "This button closes your application" (in case of a button). The description maps to the <code>description</code> property of the AT-SPI2 object.</p>
+<p>A hint or guide to describe the component. For example, "This button closes your application" (for a button). The description maps to the <code>description</code> property of the AT-SPI2 object.</p>
</li>
</ul>
</li>
</ul>
-<p>You can also create a custom reading of multi-style components. Sometimes, it is necessary to have different voice output depending on the style assigned to the UI component. The <code>default</code> style is handled "out of the box" by the accessibility framework, but you must handle any alternative styles on the application side. The elementary checkbox component offers a good example of alternative styles:</p>
+<p>You can also create a custom reading of multi-style components. Sometimes, it is necessary to have different voice output depending on the style assigned to the UI component. The <code>default</code> style is handled "out of the box" by the accessibility framework, but you must handle any alternative styles on the application side. The Elementary checkbox component offers a good example of alternative styles:</p>
<ul>
<li><code>default</code> style in a checkbox:
<p>The reading must be "<label>, <state>", where <label> is a text assigned to the checkbox and <state> is read as "selected" or "not selected", depending on the checkbox state.</p></li>
</pre>
</li>
<li>Set an image file as a background using the <code>elm_bg_file_set()</code> function.
-<p>In case of an image background, you can set additional <a href="#bg_options">options</a>.</p>
+<p>For an image background, you can set additional <a href="#bg_options">options</a>.</p>
<pre class="prettyprint">
elm_bg_file_set(bg, "/path/to/the/image", NULL);
</pre>
</pre>
</li>
<li>Set an image file as a background using the <code>elm_bg_file_set()</code> function.
-<p>In case of an image background, you can set additional <a href="#bg_options">options</a>.</p>
+<p>For an image background, you can set additional <a href="#bg_options">options</a>.</p>
<pre class="prettyprint">
elm_bg_file_set(bg, "/path/to/the/image", NULL);
</pre>
<h2 id="callback">Using the Button Callbacks</h2>
-<p>To receive notifications about the button events, listen to the following signals:</p>
+<p>To receive notifications about the button events, listen for the following signals:</p>
<ul>
<li><code>clicked</code>: The button is clicked (press/release).</li>
<p>This feature is supported in wearable applications only.</p>
-<p>The circle object component extends elementary components in a form of the circular design. Sometimes, the circle object merely provides additional UI features to an elementary component, and sometimes it works as an independent component with its own UI and functionalities.</p>
+<p>The circle object component extends Elementary components in a form of the circular design. Sometimes, the circle object merely provides additional UI features to an Elementary component, and sometimes it works as an independent component with its own UI and functionalities.</p>
<p>For more information, see the <a href="../../../../../org.tizen.native.wearable.apireference/group__CAPI__EFL__EXTENSION__CIRCLE__OBJECT__MODULE.html">Efl Extension Circle Object</a> API.</p>
</li></ul>
<h2 id="callback">Using the More Option Callbacks</h2>
-<p>To receive notifications about the more option events, listen to the following signals:</p>
+<p>To receive notifications about the more option events, listen for the following signals:</p>
<ul><li><code>item,selected</code>: The item is selected.</li>
<li><code>item,clicked</code>: An already selected item is selected again or a selector has been selected.</li>
</pre></li></ul>
<h2 id="callback">Using the Rotary Selector Callbacks</h2>
-<p>To receive notifications about the rotary selector events, listen to the following signals:</p>
+<p>To receive notifications about the rotary selector events, listen for the following signals:</p>
<ul><li><code>item,selected</code>: The item is selected.</li>
<li><code>item,clicked</code>: The item is clicked.</li></ul>
</li>
<li>Set a name to the palette with the <code>elm_colorselector_palette_name_set()</code> function. If you use the default palette, you can skip this step.</li>
<li>Add colors to the palette. If you use the default style, you can skip this step, since the default palette already has the colors selected.
-<p>The new palette is saved by the elementary configuration and you can load it again later.</p>
+<p>The new palette is saved by the Elementary configuration and you can load it again later.</p>
<p>The palette mode displays several color items for the user to select from. It is possible to add new items, or to update the color of the current item. The list of color items is called a palette, and it is associated with a unique identifier. You can create a new series of colors (a new palette) and save it under another identifier. By default, the palette mode uses the <code>default</code> palette, which contains 14 colors.</p>
</li>
<h2 id="callback">Using the Ctxpopup Callbacks</h2>
-<p>To receive notifications about the ctxpopup events, listen to the <code>dismissed</code> signal, which is called when the ctxpopup is dismissed.</p>
+<p>To receive notifications about the ctxpopup events, listen for the <code>dismissed</code> signal, which is called when the ctxpopup is dismissed.</p>
<div class="note">
<strong>Note</strong>
<li><code>Year</code>: Years since 1900. Negative value represents a year below 1900 (year value -30 represents 1870). Year default range is from 70 to 137.</li>
<li><code>Month</code>: Default value range is from 0 to 11.</li>
<li><code>Date</code>: Default value range is from 1 to 31 according to the month value.</li>
- <li><code>Hour</code>: Default value is in terms of the 24-hour format (0~23).</li>
+ <li><code>Hour</code>: Default value is in 24-hour format (0~23).</li>
<li><code>Minute</code>: Default value range is from 0 to 59.</li>
</ul>
<h2 id="callback">Using the Datetime Callbacks</h2>
-<p>To receive notifications about the datetime events, listen to the following signals:</p>
+<p>To receive notifications about the datetime events, listen for the following signals:</p>
<ul>
<li><code>changed</code>: The datetime field values are changed.</li>
<li><code>language,changed</code>: The system locale changes.</li>
<h2 id="callback">Using the Entry Callbacks</h2>
-<p>To receive notifications about the entry events, listen to the following signals:</p>
+<p>To receive notifications about the entry events, listen for the following signals:</p>
<ul>
<li><code>aborted</code>: The <strong>Escape</strong> key is pressed on a single line entry.</li>
<li><code>activated</code>: The <strong>Enter</strong> key is pressed on a single line entry.</li>
If the components are added programmatically in a different order than they appear on the screen, the default focus chain can be quite confusing. In that case, you must customize the focus chain to make it work as expected.
</div>
-<p>When the user wants to switch the focus to the next object, Elementary searches the first focusable object in the focus chain. If there is a disabled or read-only object in the focus chain, the focus skips over it to the next object in the requested direction.</p>
+<p>When the user wants to switch the focus to the next object, Elementary searches for the first focusable object in the focus chain. If there is a disabled or read-only object in the focus chain, the focus skips over it to the next object in the requested direction.</p>
<p>When the focus is changed using key presses, Elementary handles the key presses automatically. According to which key is pressed, Elementary switches the focus to the selected direction. For example, if the user presses the <strong>Tab</strong> key, the focus moves to the next object in the natural (default focus chain) order. On the other hand, if the user presses the direction keys, the focus moves to the next object in the requested direction.</p>
</tr>
<tr>
<td><code>contracted</code></td>
- <td>The item is to be contracted with the <code>elm_genlist_item_expanded_set()</code> function. The callback deletes the child items.</td>
+ <td>The item is to be collapsed with the <code>elm_genlist_item_expanded_set()</code> function. The callback deletes the child items.</td>
<td><code>Elm_Object_Item</code></td>
</tr>
<tr>
</tr>
<tr>
<td><code>contract,request</code></td>
- <td>The user wants to contract a tree branch item. The callback decides whether the item can contract (if it has any children) and calls the <code>elm_genlist_item_expanded_set()</code> function to set the state.</td>
+ <td>The user wants to collapse a tree branch item. The callback decides whether the item can collapse (if it has any children) and calls the <code>elm_genlist_item_expanded_set()</code> function to set the state.</td>
<td><code>Elm_Object_Item</code></td>
</tr>
<tr>
<h2 id="selection">Selecting Genlist Items</h2>
-<p>To select or deselect items manually, use the <code>elm_genlist_item_selected_set()</code> function. To expand or contract a tree or group item, use the <code>elm_genlist_item_expanded_set()</code> function.</p>
+<p>To select or deselect items manually, use the <code>elm_genlist_item_selected_set()</code> function. To expand or collapse a tree or group item, use the <code>elm_genlist_item_expanded_set()</code> function.</p>
<p>To prevent a selection, you can disable an item with the <code>elm_object_item_disabled_set()</code> function.</p>
<h2 id="callback">Using the Genlist Callbacks</h2>
-<p>To receive notifications about the genlist events, listen to the following signals:</p>
+<p>To receive notifications about the genlist events, listen for the following signals:</p>
<ul>
<li><code>activated</code>: The item is double-clicked or pressed (enter | return | spacebar).
<p>The <code>event_info</code> callback parameter points at an <code>Elm_Object_Item</code> object that contains the activated item.</p></li>
<p>The <code>event_info</code> callback parameter points at an <code>Elm_Object_Item</code> object that contains the unselected item.</p></li>
<li><code>expanded</code>: The item is to be expanded with the <code>elm_genlist_item_expanded_set()</code> function. The callback fills in the child items.
<p>The <code>event_info</code> callback parameter points at an <code>Elm_Object_Item</code> object that contains the item to be expanded.</p></li>
- <li><code>contracted</code>: The item is to be contracted with the <code>elm_genlist_item_expanded_set()</code> function. The callback deletes the child items.
- <p>The <code>event_info</code> callback parameter points at an <code>Elm_Object_Item</code> object that contains the item to be contracted.</p></li>
+ <li><code>contracted</code>: The item is to be collapsed with the <code>elm_genlist_item_expanded_set()</code> function. The callback deletes the child items.
+ <p>The <code>event_info</code> callback parameter points at an <code>Elm_Object_Item</code> object that contains the item to be collapsed.</p></li>
<li><code>expand,request</code>: The user wants to expand a tree branch item. The callback decides whether the item can expand (if it has any children) and calls the <code>elm_genlist_item_expanded_set()</code> function to set the state.
<p>The <code>event_info</code> callback parameter points at an <code>Elm_Object_Item</code> object that contains the item to be expanded.</p></li>
- <li><code>contract,request</code>: The user wants to contract a tree branch item. The callback decides whether the item can contract (if it has any children) and calls the <code>elm_genlist_item_expanded_set()</code> function to set the state.
- <p>The <code>event_info</code> callback parameter points at an <code>Elm_Object_Item</code> object that contains the item to be contracted.</p></li>
+ <li><code>contract,request</code>: The user wants to collapse a tree branch item. The callback decides whether the item can collapse (if it has any children) and calls the <code>elm_genlist_item_expanded_set()</code> function to set the state.
+ <p>The <code>event_info</code> callback parameter points at an <code>Elm_Object_Item</code> object that contains the item to be collapsed.</p></li>
<li><code>realized</code>: The item is created as a real evas object.
<p>The <code>event_info</code> callback parameter points at an <code>Elm_Object_Item</code> object that contains the item to be created.</p></li>
<li><code>unrealized</code>: An item is going to be unrealized. Provided content objects are deleted and the item object is deleted or put into a floating cache.
<p>This feature is supported in mobile applications only.</p>
-<p>The GLView component renders OpenGL® in an elementary object, which hides Evas GL complexity.</p>
+<p>The GLView component renders OpenGL® in an Elementary object, which hides Evas GL complexity.</p>
<p>For more information, see the <a href="../../graphics/opengl_n.htm">OpenGL® ES</a> guide and the <a href="../../../../../org.tizen.native.mobile.apireference/group__GLView.html">GLView</a> API.</p>
<p align="center"><strong>Figure: GLView component</strong></p>
<p>This feature is supported in wearable applications only.</p>
-<p>The GLView component renders OpenGL® in an elementary object, which hides Evas GL complexity.</p>
+<p>The GLView component renders OpenGL® in an Elementary object, which hides Evas GL complexity.</p>
<p>For more information, see the <a href="../../graphics/opengl_n.htm">OpenGL® ES</a> guide and the <a href="../../../../../org.tizen.native.wearable.apireference/group__GLView.html">GLView</a> API.</p>
<h2 id="callback">Using the GLView Callbacks</h2>
-<p>To receive notifications about the GLView events, listen to the following signals:</p>
+<p>To receive notifications about the GLView events, listen for the following signals:</p>
<ul>
<li><code>focused</code>: The GLView component is focused.
<h2 id="callback">Using the Icon Callbacks</h2>
-<p>To receive notifications about the icon events, listen to the following signals:</p>
+<p>To receive notifications about the icon events, listen for the following signals:</p>
<ul>
<li><code>thumb,done</code>: The <code>elm_icon_thumb_set()</code> function is completed with success.</li>
<li><code>thumb,error</code>: The <code>elm_icon_thumb_set()</code> function fails.</li>
<p>To configure the image component:</p>
<ul>
-<li><p>Disable elementary scaling so that the image does not scale but resizes on both directions:</p>
+<li><p>Disable Elementary scaling so that the image does not scale but resizes on both directions:</p>
<pre class="prettyprint">
elm_image_no_scale_set(image, EINA_TRUE);
elm_image_resizable_set(image, EINA_TRUE, EINA_TRUE);
<p>To configure the image component:</p>
<ul>
-<li><p>Disable elementary scaling so that the image does not scale but resizes on both directions:</p>
+<li><p>Disable Elementary scaling so that the image does not scale but resizes on both directions:</p>
<pre class="prettyprint">
elm_image_no_scale_set(image, EINA_TRUE);
elm_image_resizable_set(image, EINA_TRUE, EINA_TRUE);
<h2 id="callback">Using the Image Callbacks</h2>
-<p>To receive notifications about the image events, listen to the following signals:</p>
+<p>To receive notifications about the image events, listen for the following signals:</p>
<ul>
<li><code>drop</code>: An image typed object is dropped onto the object in question. <p>The <code>event_info</code> callback parameter is the path to that image file.</p></li>
<li><code>clicked</code>: The image is clicked.
<div id="container"><div id="contents"><div class="content">
<h1>Index</h1>
-<p>The index UI component gives you an index for fast access to a group of other UI items. The index component is by default hidden, but it appears when the user clicks over its reserved area in the canvas. For more information, see the <a href="../../../../../org.tizen.native.mobile.apireference/group__Index.html">Index</a> API.</p>
+<p>The index UI component gives you an index for quick access to a group of other UI items. The index component is by default hidden, but it appears when the user clicks over its reserved area on the canvas. For more information, see the <a href="../../../../../org.tizen.native.mobile.apireference/group__Elm__Index.html">Index</a> API.</p>
<p>This feature is supported in mobile applications only.</p>
<p>This feature is supported in wearable applications only.</p>
-<p>The index component gives you an index for fast access to a group of other UI items. The index component is by default hidden, but it appears when the user clicks over its reserved area in the canvas.</p>
+<p>The index component gives you an index for quick access to a group of other UI items. The index component is by default hidden, but it appears when the user clicks over its reserved area on the canvas.</p>
<p>In the default theme, the index component is a one-finger-wide area on the right side of the index component's container. Generally, it is used together with lists, generic lists, or generic grids.</p>
<h2 id="callback">Using the Index Callbacks</h2>
-<p>To receive notifications about the index events, listen to the following signals:</p>
+<p>To receive notifications about the index events, listen for the following signals:</p>
<ul>
<li><code>changed</code>: The selected index item changes.
<p>The <code>event_info</code> callback parameter is the selected item's data pointer.</p></li>
<h2 id="callback">Using the Label Callbacks</h2>
-<p>To receive notifications about the label events, listen to the following signals:</p>
+<p>To receive notifications about the label events, listen for the following signals:</p>
<ul>
<li><code>language,changed</code>: The program language is changed.</li>
<li><code>slide,end</code>: The slide reaches the end.</li>
<h2 id="callback">Using the List Callbacks</h2>
- <p>To receive notifications about the list events, listen to the following signals:</p>
+ <p>To receive notifications about the list events, listen for the following signals:</p>
<ul>
<li><code>activated</code>: The item is double-clicked or pressed (enter | return | spacebar).
<p>The <code>event_info</code> callback parameter points at the activated item.</p></li>
<h2 id="callback">Using the List Callbacks</h2>
- <p>To receive notifications about the list events, listen to the following signals:</p>
+ <p>To receive notifications about the list events, listen for the following signals:</p>
<ul>
<li><code>activated</code>: The item is double-clicked or pressed (enter | return | spacebar).
<p>The <code>event_info</code> callback parameter points at the activated item.</p></li>
<div id="container"><div id="contents"><div class="content">
<h1>Panel</h1>
-<p>The panel UI component can contain subobjects. It can be expanded or contracted by clicking on the button on its edge. The panel component inherits from the <a href="container_layout_n.htm">layout</a> component, which means that layout functions can be used on the panel component. For more information, see the <a href="../../../../../org.tizen.native.mobile.apireference/group__Panel.html">Panel</a> API.</p>
+<p>The panel UI component can contain subobjects. It can be expanded or collapsed by clicking on the button on its edge. The panel component inherits from the <a href="container_layout_n.htm">layout</a> component, which means that layout functions can be used on the panel component. For more information, see the <a href="../../../../../org.tizen.native.mobile.apireference/group__Elm__Panel.html">Panel</a> API.</p>
<p>This feature is supported in mobile applications only.</p>
<h2 id="basic">Basic Usage</h2>
<p>This feature is supported in mobile applications only.</p>
- <p>The photocam component displays high resolution photos taken from digital cameras. It provides a way to zoom in the photo, load it fast, and fit it nicely on the screen. It is optimized for the <code>.jpeg</code> image format and has a low memory footprint.</p>
+ <p>The photocam component displays high resolution photos taken from digital cameras. It provides a way to zoom in the photo, load it quickly, and fit it nicely on the screen. It is optimized for the <code>.jpeg</code> image format and has a low memory footprint.</p>
<p>The photocam component implements the scroller interface, which means that scroller functions can be used with the photocam component.</p>
<h2 id="photocam_cb">Using the Photocam Callbacks</h2>
-<p>To receive notifications about the photocam events, listen to the following signals:</p>
+<p>To receive notifications about the photocam events, listen for the following signals:</p>
<ul>
<li><code>clicked</code>: The photo is clicked without dragging around.</li>
<li><code>press</code>: The photo is pressed.</li>
<p>This feature is supported in mobile applications only.</p>
-<p>The plug component shows an <code>Evas_Object</code> created by another process. It can be used anywhere the same way as any other elementary UI component.</p>
+<p>The plug component shows an <code>Evas_Object</code> created by another process. It can be used anywhere the same way as any other Elementary UI component.</p>
<p>For more information, see the <a href="../../../../../org.tizen.native.mobile.apireference/group__Plug.html">Plug</a> API.</p>
<h2 id="callback">Using the Plug Callbacks</h2>
-<p>To receive notifications about the plug events, listen to the following signals:</p>
+<p>To receive notifications about the plug events, listen for the following signals:</p>
<ul>
<li><code>clicked</code>: The image is clicked (press/release).
<p>The <code>event_info</code> callback parameter is <code>NULL</code>.</p></li>
<p>This feature is supported in wearable applications only.</p>
-<p>The plug component shows an <code>Evas_Object</code> created by another process. It can be used anywhere the same way as any other elementary UI component.</p>
+<p>The plug component shows an <code>Evas_Object</code> created by another process. It can be used anywhere the same way as any other Elementary UI component.</p>
<p>For more information, see the <a href="../../../../../org.tizen.native.wearable.apireference/group__Plug.html">Plug</a> API.</p>
<h2 id="callback">Using the Plug Callbacks</h2>
-<p>To receive notifications about the plug events, listen to the following signals:</p>
+<p>To receive notifications about the plug events, listen for the following signals:</p>
<ul>
<li><code>clicked</code>: The image is clicked (press/release).
<p>The <code>event_info</code> callback parameter is <code>NULL</code>.</p></li>
<h2 id="callback">Using the Popup Callbacks</h2>
-<p>To receive notifications about the popup events, listen to the following signals:</p>
+<p>To receive notifications about the popup events, listen for the following signals:</p>
<ul>
<li><code>timeout</code>: The popup is closed as a result of the timeout.
</li>
<h2 id="callback">Using the Segmentcontrol Callbacks</h2>
-<p>To receive notifications about the segmentcontrol events, listen to the <code>changed</code> signal, which is called when the user clicks on a segment item that was not previously selected.</p>
+<p>To receive notifications about the segmentcontrol events, listen for the <code>changed</code> signal, which is called when the user clicks on a segment item that was not previously selected.</p>
<div class="note">
<strong>Note</strong>
<h2 id="callback">Using the Spinner Callbacks</h2>
-<p>To receive notifications about the spinner events, listen to the following signals:</p>
+<p>To receive notifications about the spinner events, listen for the following signals:</p>
<ul>
<li><code>changed</code>: The spinner value changes.</li>
<li><code>delay,changed</code>: The user stops dragging for a very short period or releases the finger or mouse. The signal is emitted a short time after the user changes the value, to avoid possibly expensive reactions to the value change.</li>
</li>
<li>Set objects or texts to the layout with the <code>elm_object_part_content_set()</code> or <code>elm_object_part_text_set()</code> function.</li>
<li>Elementary can send Edje signals to the EDC part using the <code>elm_layout_signal_emit()</code> function. You can also use the <code>elm_layout_signal_callback_add()</code> function to receive signals.
- <p>Use the following code to listen to any signals sent by the layout:</p>
+ <p>Use the following code to listen for any signals sent by the layout:</p>
<pre class="prettyprint">
elm_layout_signal_callback_add(layout, "*", "*", _signal_cb, NULL);
<p>To access inline array data:</p>
<ul>
<li>
-<p>To search a member in an inline array, use the <code>eina_inarray_search()</code> function that runs a linear walk looking for the given data:</p>
+<p>To search for a member in an inline array, use the <code>eina_inarray_search()</code> function that runs a linear walk looking for the given data:</p>
<ul><li>The first parameter is a pointer to the array variable returned by the <code>eina_inarray_new()</code> function.</li>
<li>The second parameter is the data used by the callback function to run the comparison.</li>
<h2 id="hash" name="hash">Hash Tables</h2>
<p>The <code>Eina_Hash</code> provides a way to store values in association with a key. For example, if you want to store some tuples into a table, you can do it using the <code>Eina_Hash</code>.</p>
-<p>The <code>Eina_Hash</code> is implemented using an array of "buckets" where each bucket is a pointer to a structure that is the head of a red-black tree. This implementation makes it very robust against week keys as in the worst case scenario, you can still depend on an efficient binary tree implementation.</p>
+<p>The <code>Eina_Hash</code> is implemented using an array of "buckets" where each bucket is a pointer to a structure that is the head of a red-black tree. This implementation makes it very robust against weak keys as, in the worst case scenario, you can still depend on an efficient binary tree implementation.</p>
<h3 id="hash_create" name="hash_create">Creating a Hash Table</h3>
<li>The first parameter is the callback function that performs the actual animation.</li>
<li>The second parameter is the data passed to the callback function. This is usually the Evas object to animate.</li>
</ul>
-<p>This function works the same way as the <code>ecore_animation_timeline_add()</code> function, except that its interval is based on the frame rate. Using the frame rate as a basis benefits performance, especially in case of multiple animations, since it enables you to use a different timer for each callback function.</p>
+<p>This function works the same way as the <code>ecore_animation_timeline_add()</code> function, except that its interval is based on the frame rate. Using the frame rate as a basis benefits performance, especially in the case of multiple animations, since it enables you to use a different timer for each callback function.</p>
<div class="note">
<strong>Note</strong>
<h2 id="position" name="position">Using Position Mappings</h2>
-<p>Position mappings allow you to create various non-linear changes in your animation to implement the evolution of a given position in accordance with the desired effects. You can apply dynamic changes to any attribute of the Evas object, such as position, width, height, scale, angle, and color.</p>
+<p>Position mappings allow you to create various non-linear changes in your animation to implement the evolution of a given position according to the desired effects. You can apply dynamic changes to any attribute of the Evas object, such as position, width, height, scale, angle, and color.</p>
<p>When you use the animation callback function with the <code>ecore_animator_timeline_add()</code> function, the animator passes to the callback a timeline position parameter with a value between 0.0 (start) and 1.0 (end) to indicate where along the timeline the animator is running. To create a non-linear animation, you can map the position value to one of several curves and mappings using the <code>ecore_animator_pos_map()</code> function:</p>
<ul>
<li>The first parameter is the current position value, which ranges from 0.0 to 1.0.</li>
<li>Resizing effect
-<p>The resizing effect allows you to design an interpolation of the width and height attributes of one or more target elements using the <code>elm_transit_effect_resizing_add()</code> function. The function defines the width and height of the object at the start and end of the animation.</p>
+<p>The resizing effect allows you to design an interpolation of the width and height attributes of 1 or more target elements using the <code>elm_transit_effect_resizing_add()</code> function. The function defines the width and height of the object at the start and end of the animation.</p>
<div class="note">
<strong>Note</strong>
</li>
<li>When you have an instance of the Evas object and the Evas canvas, you can create basic Evas objects as child objects for the parent Evas canvas.
-<p>The following example creates a background <code>Evas_Object</code> with white color, a size of 480 x 800, a position on window at 0,0 by X and Y axis, and shows the object on the screen:</p>
+<p>The following example creates a background <code>Evas_Object</code> with white color, a size of 480 x 800, a position on the window at 0,0 on X and Y axes, and shows the object on the screen:</p>
<pre class="prettyprint">
ad->bg = evas_object_rectangle_add(evas);
<p align="center"><img alt="Changing the opacity" src="../../../images/changing_opacity.png" /></p>
</li>
<li>
-<p>To hide the object, when it is not needed:</p>
+<p>To hide the object when it is not needed:</p>
<pre class="prettyprint">
static void
<p align="center"><strong>Figure: Changed object order</strong></p>
<p align="center"><img alt="Changed object order" src="../../../images/changed_order.png" /></p>
</li>
-<li>To place an object to the top or bottom of its layer in the canvas object stack, use the <code>evas_object_raise()</code> or <code>evas_object_lower()</code> function.
+<li>To place an object to the top or bottom of its layer on the canvas object stack, use the <code>evas_object_raise()</code> or <code>evas_object_lower()</code> function.
<p>In the following example, the <code>_lower_cb()</code> callback puts the canvas background at the bottom, showing both the rectangles that are on higher levels. On the other hand, the <code>_raise_cb()</code> callback puts the background to the top, hiding both the rectangles that are now on lower levels.</p>
<pre class="prettyprint">
<p>You can create 3D effects with maps using the Z coordinate: the higher the Z value, the further back the point is located. Smaller, usually negative, values mean that the point is closer to the user.</p>
-<p>When handling 3D effects, you must also be familiar with the concept of the object <strong>back face</strong>. An object is said to be facing the user, when all its points are placed in a clockwise formation. Rotating the map around its Y axis swaps the order of the points into a counter-clockwise formation, making the object face away from the user and revealing the object back face. The back face concept is especially relevant in lighting.</p>
+<p>When handling 3D effects, you must also be familiar with the concept of the object <strong>back face</strong>. An object is said to be facing the user when all its points are placed in a clockwise formation. Rotating the map around its Y axis swaps the order of the points into a counter-clockwise formation, making the object face away from the user and revealing the object back face. The back face concept is especially relevant in lighting.</p>
<p>The following figure shows an object rotating around the Y axis. On the left, the object is facing the user, and on the right the face is away from the user, and you can only see the object back face.</p>
<p align="center"><strong>Figure: Rotating around the Y axis</strong></p>
<ul>
<li>To determine whether a map is facing the user, use the <code>evas_map_util_clockwise_get()</code> function. The function returns <code>EINA_TRUE</code> if the map is facing the user, and <code>EINA_FALSE</code> if the map is facing away from the user. Check the face orientation after applying all other operations to the map.</li>
-<li>To transform a map and apply a 3D rotation to the mapped object, use the <code>evas_map_util_3d_rotate()</code> function. You can apply the rotation around any point in the canvas (including a Z coordinate). You can also apply the rotation around any of the 3 axes.
+<li>To transform a map and apply a 3D rotation to the mapped object, use the <code>evas_map_util_3d_rotate()</code> function. You can apply the rotation around any point on the canvas (including a Z coordinate). You can also apply the rotation around any of the 3 axes.
<p>The following figure shows the result of starting from this simple setup, and setting the map so that the blue square rotates around the Y axis.</p>
<p>The <code>evas_object_image_filled_add()</code> function creates a new image object that automatically scales its bound image to the object area. This is a helper function around the <code>evas_object_image_add()</code> and <code>evas_object_image_filled_set()</code> functions.</p>
-<p>Scaled images' quality can differ according to scaling algorithms. Smooth scaling improves the image quality in the process of size reducing or enlarging. Evas runs its own smooth scaling algorithm by default and provides an API for you to disable the function.</p>
+<p>A scaled image's quality can vary depending on the scaling algorithm. Smooth scaling improves the image quality in the process of size reducing or enlarging. Evas runs its own smooth scaling algorithm by default and provides an API for you to disable the function.</p>
-<p>The algorithm is implemented using the SIMD (Single Instruction Multiple Data) vectorization in case of software rendering. It is optimized on Intel and ARM CPU through MMX and NEON command respectively.</p>
+<p>The algorithm is implemented using the SIMD (Single Instruction Multiple Data) vectorization for software rendering. It is optimized for Intel and ARM CPU through the MMX and NEON instruction sets respectively.</p>
<p>There is a trade-off between image smoothness and rendering performance. The load gets bigger as the image gets bigger. Users can avoid such scaling overload by using the same size of the image object and the source image.</p>
</ul>
<h3>Setting Raw Data to Image Object</h3>
-<p>You can set raw data to the image object manually using the <code>evas_object_image_data_set()</code> function instead of setting an image file as the data source. The image data must be in raw data form. In case of an 200x200 sized image with alpha channel enabled (32 bits per pixel), the size of the image data is 14000 (=200*200*4) bytes.</p>
+<p>You can set raw data to the image object manually using the <code>evas_object_image_data_set()</code> function instead of setting an image file as the data source. The image data must be in raw data form. For a 200x200 sized image with alpha channel enabled (32 bits per pixel), the size of the image data is 14000 (=200*200*4) bytes.</p>
<p>Image objects fetch metadata such as width or height from the header of the image files. Since the raw data does not have the metadata, you must set the size of the image using the <code>evas_object_image_size_set()</code> function.</p>
</pre>
<h4>Specifying Borders</h4>
-<p>With Evas, you can specify image margins to be treated as borders. The margins then maintain their aspects when the image is resized. This makes setting frames around other UI objects easier. The following figure illustrates the border behavior, when the image is resized.</p>
+<p>With Evas, you can specify image margins to be treated as borders. The margins then maintain their aspects when the image is resized. This makes setting frames around other UI objects easier. The following figure illustrates the border behavior when the image is resized.</p>
<p align="center"><strong>Figure: Borders in Evas</strong></p>
<p align="center"><img alt="Borders in Evas" src="../../../images/9patch.png" /></p>
<h2 id="ui_rendering" name="ui_rendering">UI Rendering Modes</h2>
-<p>Evas removes the need to know about the characteristics of your display system or what graphics calls are used to draw them and how. It deals on an object level where all you do is create and manipulate objects in a canvas, set their properties, and the rest is done for you. This rendering method is called the retained mode, as opposed to the immediate mode used in most display and windowing systems:</p>
+<p>Evas removes the need to know about the characteristics of your display system or what graphics calls are used to draw them and how. It operates at an object level, where all you do is create and manipulate objects on a canvas, set their properties, and the rest is done for you. This rendering method is called the retained mode, as opposed to the immediate mode used in most display and windowing systems:</p>
<ul>
<li><strong>Immediate mode</strong>
<p align="center"><strong>Figure: Retained mode</strong></p>
<p align="center"><img alt="Retained mode" src="../../../images/retained_mode.png" /></p>
-<p>Evas is a structural system in which you create and manage display objects and their properties, and as a result of this higher level state management, the canvas is able to redraw the set of objects when needed to represent the current state of the canvas.</p>
+<p>Evas is a structural system in which you create and manage display objects and their properties, and as a result of this higher-level state management, the canvas is able to redraw the set of objects when needed to represent the current state of the canvas.</p>
<p>A program creates the display objects and their properties as a series of commands, as in the following pseudo code:</p>
<pre class="prettyprint">
line_handle = create_line();
render scene;
</pre>
-<p>The pseudo code looks longer than in the immediate mode, but when the display needs to be refreshed or updated, you only need to move, resize, show, or hide the objects that need to change. You can think at the object logic level, and the canvas software does the rest of the work for you, figuring out what changed in the canvas since it was last drawn and how to most efficiently redraw the canvas and its contents to reflect the current state, and doing the actual drawing of the canvas.</p>
+<p>The pseudo code looks longer than in the immediate mode, but when the display needs to be refreshed or updated, you only need to move, resize, show, or hide the objects that need to change. You can think at the object logic level, and the canvas software does the rest of the work for you, figuring out what changed on the canvas since it was last drawn and how to most efficiently redraw the canvas and its contents to reflect the current state, and doing the actual drawing of the canvas.</p>
<p>The retained mode allows you to think in a more natural way when dealing with a display, and saves time and effort of working out how to load and display images in the current display system. Since Evas is portable across different display systems, you can port and display the code on different display systems with little work.</p>
<p>Evas is a display system somewhere between a UI component set and an immediate mode display system. It retains basic display logic, but does little high-level logic, such as scroll bars, sliders, or push buttons.</p>
<h2 id="ecore" name="ecore">Ecore Events</h2>
-<p>Ecore events are used for low-level handling of events, such as key presses, network connections, and communication with sub-processes. In case of shortcuts, the low-level handling of key presses is particularly useful: instead of adding a signal handler to a specific graphical element, you can add one globally to guarantee that no matter which UI component is currently receiving events, the shortcut is caught correctly.</p>
+<p>Ecore events are used for low-level handling of events, such as key presses, network connections, and communication with sub-processes. For shortcuts, the low-level handling of key presses is particularly useful: instead of adding a signal handler to a specific graphical element, you can add one globally to guarantee that no matter which UI component is currently receiving events, the shortcut is caught correctly.</p>
<p>Ecore events can also be used to implement new graphical back-ends. However, they are low-level and not useful for most applications.</p>
<p>In addition to using predefined Ecore events, you can create your own events with the <code>ecore_event_type_new()</code> function. The function generates a new unique identifier, which you can use as the event type parameter when managing your events and event handlers.</p>
<h2 id="apply" name="apply">Using the System Font</h2>
-<p>Tizen provides a special "Tizen" font name, which does not match with any specific font; it is just an alias for a system-defined font (system font). If you create a text object (with EDC or in the C code) with the "Tizen" font name, the system font is loaded into the user application when the object is created.</p>
+<p>Tizen provides a special "Tizen" font name, which does not match with any specific font; it is simply an alias for the system-defined font (system font). If you create a text object (with EDC or in the C code) with the "Tizen" font name, the system font is loaded into the user application when the object is created.</p>
<p>You can use the "Tizen" font name when you <a href="#edc">create a text or textblock part</a> in the application's EDC file, when you <a href="#edje">use the text class</a>, or when you <a href="#component">set the UI component text font</a> in the C code.</p>
<h1>Graphical Objects</h1>
<p>Evas is a clean display canvas API for several target display systems that can draw, for example, anti-aliased text, smooth super- and sub-sampled scaled images, and alpha-blend objects. Evas optimizes the rendering pipeline to minimize the effort of redrawing changes made to the canvas, and so takes this work out of your hand, saving a lot of time and energy.</p>
-<p>Evas abstracts any need to know much about what the characteristics of your display system are, what graphics calls are used to draw them, and how. It deals on an object level where all you do is create and manipulate objects in a canvas and set their properties.</p>
+<p>Evas abstracts any need to know much about what the characteristics of your display system are, what graphics calls are used to draw them, and how. It operates at an object level, where all you do is create and manipulate objects on a canvas and set their properties.</p>
<p>The main features of Evas graphical rendering are:</p>
<p>For those familiar with traditional game programming, this is familiar, except that you have also implemented the main loop with an infinite while or for loop that fetches input events, updates the game world, renders the updated scene, and then loops and repeats as quickly as it can.</p>
-<p>In case of EFL, the main loop is not "dumb" and does not consume CPU resources unless there is work to do. It sleeps and consumes no CPU time until an event happens (except in rare circumstances, for example, when you use Idlers that are called in a loop during what normally would be idle time waiting for something to happen). From EFL's point of view, all of this is handled in Ecore, and it supports many constructs for manipulating the main loop in a logical and flexible way. EFL handles animation through animators, where the main loop handles timing out and scheduling these at regularly spaced intervals in time (on a best-effort basis), as with timers, pollers, idle enterers, idle exiters, idlers, jobs, fd handlers (file descriptor handlers) and event handlers.</p>
+<p>In EFL, the main loop is not "dumb" and does not consume CPU resources unless there is work to do. It sleeps and consumes no CPU time until an event happens (except in rare circumstances, for example, when you use Idlers that are called in a loop during what normally would be idle time waiting for something to happen). From EFL's point of view, all of this is handled in Ecore, and it supports many constructs for manipulating the main loop in a logical and flexible way. EFL handles animation through animators, where the main loop handles timing out and scheduling these at regularly spaced intervals in time (on a best-effort basis), as with timers, pollers, idle enterers, idle exiters, idlers, jobs, fd handlers (file descriptor handlers) and event handlers.</p>
<p>In the EFL view, the application, when executing any callbacks other than idlers, is "active". It goes in and out of this active state by calling the idle enterer and exiter callbacks (edge-triggered callbacks), which are triggered whenever going in and out of the idle state. Idlers themselves do not transition the main loop as such from being in an idle state, so any Idler that needs to "wake up" the loop conceptually to become active needs to queue something that ordinarily wakes up the main loop, such as a job or timer. This is the only exception due to the conceptual model and the need for efficiency (not entering and exiting idle per idler call).</p>
<p>For more information on supporting multiple screens in one EDC, see the <a href="multiple_screens_n.htm">Multiple Screen Support</a> guide.</p>
</li>
<li id="Sounds" name="Sounds"><code>sounds</code> block
-<p>The <code>sounds</code> block contains one or more sound sample and tone items.</p>
+<p>The <code>sounds</code> block contains 1 or more sound sample and tone items.</p>
<ul>
<li id="Tone"><code>tone [tone name] [frequency]</code>
<p>Sets the sound of the given frequency.</p>
<h1 id="color_classes_block" name="color_classes_block">Color Classes Block</h1>
-<p>The <code>color_classes</code> block contains one or more <code>color_class</code> blocks. Each <code>color_class</code> block allows you to name an arbitrary group of colors to be used in the theme. The application can use that name to alter the color values at runtime.</p>
+<p>The <code>color_classes</code> block contains 1 or more <code>color_class</code> blocks. Each <code>color_class</code> block allows you to name an arbitrary group of colors to be used in the theme. The application can use that name to alter the color values at runtime.</p>
<p align="center"><strong>Figure: Color classes block</strong></p>
<p align="center"><img width="450" alt="Color classes block" src="../../../images/diagram_color_classes.png"/></p>
}
</pre>
-<p>The <code>parts</code> block contains one or more <a href="learn_edc_part_n.htm">part</a>. Each part describes a visual element and has a type, such as <code>text</code>, <code>image</code>, or <code>table</code>.</p>
+<p>The <code>parts</code> block contains 1 or more <a href="learn_edc_part_n.htm">part</a> blocks. Each part describes a visual element and has a type, such as <code>text</code>, <code>image</code>, or <code>table</code>.</p>
</li>
<li id="Script" name="Script"><code>group.script</code> block
}
</pre>
-<p>The <code>script</code> block is used to inject embryo scripts to a given Edje theme. It functions in two modalities: when it is included inside a <code>program</code> block, the script is executed every time the <a href="learn_edc_program_n.htm">program</a> is run, and when included directly into a <code>group</code>, <code>part</code>, or <code>description</code> block, it is executed once at the load time, in the load order.</p>
+<p>The <code>script</code> block is used to inject embryo scripts to a given Edje theme. It functions in 2 modalities: when it is included inside a <code>program</code> block, the script is executed every time the <a href="learn_edc_program_n.htm">program</a> is run, and when included directly into a <code>group</code>, <code>part</code>, or <code>description</code> block, it is executed once at the load time, in the load order.</p>
</li>
<li id="Limits" name="Limits"><code>group.limits</code> block
}
</pre>
-<p>The <code>programs</code> group contain one or more <a href="learn_edc_program_n.htm">program</a>. Each program contains code related to the interaction and animation of the visual elements.</p>
+<p>The <code>programs</code> group contains 1 or more <a href="learn_edc_program_n.htm">program</a> blocks. Each program contains code related to the interaction and animation of the visual elements.</p>
</li>
</ul>
<h1 id="images_block" name="images_block">Images Block</h1>
-<p>The <code>images</code> block is used to list the image files used in the theme. The used compression methods are also defined here. In addition to the top-level, the <code>images</code> blocks can be included inside other blocks, usually <code>collections</code>, <code>group</code>, and <code>part</code>. Using the <code>images</code> block on the top-level makes file list maintenance easier, when the theme is split among multiple files.</p>
+<p>The <code>images</code> block is used to list the image files used in the theme. The used compression methods are also defined here. In addition to the top-level, the <code>images</code> blocks can be included inside other blocks, usually <code>collections</code>, <code>group</code>, and <code>part</code>. Using the <code>images</code> block on the top-level makes file list maintenance easier when the theme is split among multiple files.</p>
<p align="center"><strong>Figure: Images block</strong></p>
<p align="center"><img width="450" alt="Images block" src="../../../images/diagram_images.png"/></p>
}
</pre>
-<p>The <code>set</code> block is used to define an image with different content depending on its size. In addition to the top-level, the <code>set</code> blocks can be included inside other blocks, normally <code>collections</code>, <code>group</code>, and <code>part</code>. Using the <code>set</code> block on the top-level makes file list maintenance easier, when the theme is split among multiple files.</p>
+<p>The <code>set</code> block is used to define an image with different content depending on its size. In addition to the top-level, the <code>set</code> blocks can be included inside other blocks, normally <code>collections</code>, <code>group</code>, and <code>part</code>. Using the <code>set</code> block on the top-level makes file list maintenance easier when the theme is split among multiple files.</p>
<ul>
<li><code>name [image name]</code>
</tr>
<tr>
<td><a href="learn_edc_part_n.htm">parts</a></td>
- <td>Used to represent the most basic design elements of the theme, for example, a part block can represent a line in a border or a label on a button. Parts contain one or more part blocks.</td>
+ <td>Used to represent the most basic design elements of the theme, for example, a part block can represent a line in a border or a label on a button. Parts contain 1 or more part blocks.</td>
</tr>
<tr>
<td><a href="learn_edc_program_n.htm">programs</a></td>
- <td>Defines how your interface reacts to events. A program block can change the part state or trigger other events. Programs contain one or more program blocks.</td>
+ <td>Defines how your interface reacts to events. A program block can change the part state or trigger other events. Programs contain 1 or more program blocks.</td>
</tr>
<tr>
<td><a href="learn_edc_images_n.htm">images</a></td>
</tr>
<tr>
<td><a href="learn_edc_color_classes_n.htm">color_classes</a></td>
- <td>Contains one or more color_class blocks. Each color_class block allows you to name an arbitrary group of colors to be used in the theme.</td>
+ <td>Contains 1 or more color_class blocks. Each color_class block allows you to name an arbitrary group of colors to be used in the theme.</td>
</tr>
<tr>
<td><a href="learn_edc_styles_n.htm">styles</a></td>
- <td>Contains one or more style blocks. A style block is used to create style <code><tags></code> for advanced textblock formatting.</td>
+ <td>Contains 1 or more style blocks. A style block is used to create style <code><tags></code> for advanced textblock formatting.</td>
</tr>
</tbody>
</table>
<li><code>NONE</code>: Textblock is non-editable</li>
<li><code>PLAIN</code>: Textblock is non-editable, but selectable</li>
<li><code>EDITABLE</code>: Textblock is editable</li>
-<li><code>PASSWORD</code>: Textblock is editable if the Edje object has the keyboard focus and the part has the Edje focus (or selectable always regardless of focus). In case of the password mode, the textblock is not selectable and all text characters are replaced with * characters, but they remain editable and pastable.</li>
+<li><code>PASSWORD</code>: Textblock is editable if the Edje object has the keyboard focus and the part has the Edje focus (or selectable always regardless of focus). In password mode, the textblock is not selectable and all text characters are replaced with * characters, but they remain editable and pastable.</li>
</ul>
</li>
}
</pre>
-<p>The <code>description</code> block is used to define the style and layout properties of a part in a given state. Every part can have one or more description blocks.</p>
+<p>The <code>description</code> block is used to define the style and layout properties of a part in a given state. Every part can have 1 or more description blocks.</p>
<ul>
}
</pre>
-<p>The <code>rel1</code> and <code>rel2</code> blocks are used to define the position of each corner of the part's container. <code>rel1</code> refers to the left-top corner and <code>rel2</code> to the right-down corner.</p>
+<p>The <code>rel1</code> and <code>rel2</code> blocks are used to define the position of each corner of the part's container. <code>rel1</code> refers to the top left corner and <code>rel2</code> to the bottom right corner.</p>
<ul>
}
</pre>
-<p>The <code>origin</code> block is used to place the starting point inside the displayed element that is used to render the tile. By default, the origin is set at the element's left-top corner.</p>
+<p>The <code>origin</code> block is used to place the starting point inside the displayed element that is used to render the tile. By default, the origin is set at the element's top left corner.</p>
<ul>
</li>
<li id="description_text_ellipsis"><code>ellipsis [point of balance]</code>
-<p>Balances the text in a relative point from 0.0 to 1.0. This point is the last section of the string to be cut out in case of a resize to a smaller size than the text itself. The default value is 0.0.</p>
+<p>Balances the text in a relative point from 0.0 to 1.0. This point is the last section of the string to be cut out if it is resized to a smaller size than the text itself. The default value is 0.0.</p>
</li>
</ul>
<ul>
<li id="description_map_perspective"><code>perspective [another part's name]</code>
-<p>Sets the part that is used as the perspective point for giving a part a 3D look. The perspective point must have a perspective section that provides zplane and focal properties. The center of this part is used as the focal point, thus size, color, and visibility are not relevant, just the center point, zplane, and focal are used. This also implicitly enables perspective transforms.</p>
+<p>Sets the part that is used as the perspective point for giving a part a 3D look. The perspective point must have a perspective section that provides zplane and focal properties. The center of this part is used as the focal point, thus size, color, and visibility are not relevant; only the center point, zplane, and focal are used. This also implicitly enables perspective transforms.</p>
</li>
<li id="description_map_light"><code>light [another part's name]</code>
<li id="description_map_color"><code>color [point] [red] [green] [blue] [alpha]</code>
<p>Sets the color of a vertex in the map. The colors are linearly interpolated between vertex points through the map. The default color of a vertex in a map is white solid (255, 255, 255, 255), which means it has no affect on modifying the part pixels. Currently only 4 points are supported:</p>
<ul>
-<li>0: Left-top point of a part</li>
-<li>1: Right-top point of a part</li>
-<li>2: Left-bottom point of a part</li>
-<li>3: Right-bottom point of a part</li>
+<li>0: Top left point of a part</li>
+<li>1: Top right point of a part</li>
+<li>2: Bottom left point of a part</li>
+<li>3: Bottom right point of a part</li>
</ul>
</li>
<li id="description_map_rotation" name="description_map_rotation"><code>map.rotation</code> block
<h1 id="styles_block" name="styles_block">Styles Block</h1>
-<p>The <code>styles</code> block contains one or more <code>style</code> blocks. A <code>style</code> block is used to create style <code><tags></code> for advanced textblock formatting.</p>
+<p>The <code>styles</code> block contains 1 or more <code>style</code> blocks. A <code>style</code> block is used to create style <code><tags></code> for advanced textblock formatting.</p>
<p align="center"><strong>Figure: Styles block</strong></p>
<p align="center"><img width="450" alt="Styles block" src="../../../images/diagram_styles.png"/></p>
<ul>
<li>To set a callback, use the <code>_my_cb_func()</code> function. Its first parameter is the data passed to it (optional), and the second one is the Ecore file descriptor handler. Its return value is, as in most Ecore callbacks, <code>ECORE_CALLBACK_RENEW</code> or <code>ECORE_CALLBACK_CANCEL</code>. It tells Ecore whether it wants to be called again or whether its treatment is finished.</li>
-<li>To listen to events, use the <code>ecore_main_fd_handler_add()</code> function.</li>
+<li>To listen for events, use the <code>ecore_main_fd_handler_add()</code> function.</li>
<li>To wait for incoming data (that is, to read data) on the <code>my_fd</code> file descriptor, passing <code>my_data</code>:
<p>In Tizen, each device has a scale value in proportion to the display. If scaling is enabled, the objects are drawn on the display by multiplying the user-defined object size with the device scale. If the base scale is set, the objects are drawn by dividing the user-defined object size by the base scale and multiplying it with the device scale.</p>
-<p>If you use the scale feature without setting the base scale, the result is the same as if you set the base scale to 1.0. Then you do not need to care about the base scale variables, because the pixels roll like a virtual pixel. For example, if you set 1 pixel in 129 DPI without setting the base scale value, the 1 pixel before scaling is equivalent to 1 real physical pixel after scaling. In case of 233 DPI, it is the same with 1.8 pixels after scaling.</p>
+<p>If you use the scale feature without setting the base scale, the result is the same as if you set the base scale to 1.0. Then you do not need to care about the base scale variables, because the pixels roll like a virtual pixel. For example, if you set 1 pixel in 129 DPI without setting the base scale value, the 1 pixel before scaling is equivalent to 1 real physical pixel after scaling. For 233 DPI, it is the same as 1.8 pixels after scaling.</p>
-<p>Always consider the pixel before scaling when defining the application UI, in order to ensure a proper UI display on the screen with a diversity of densities.</p>
+<p>Always consider the pixel before scaling when defining the application UI, in order to ensure a proper UI display on screens with different densities.</p>
<pre class="prettyprint">
/* Conversion formula */
<p>For more information, see the Elementary Widgets API (in <a href="../../../../../org.tizen.native.mobile.apireference/group__elm__widget__group.html">mobile</a> and <a href="../../../../../org.tizen.native.wearable.apireference/group__elm__widget__group.html">wearable</a> applications).</p>
</li>
-<li>In case of the elm_scroller, it is a UI component and an implementation of a scrollable interface at the same time. The following functions can be used for all UI components, which implement a scrollable interface, such as <code>elm_entry</code> and <code>elm_genlist</code>:
+<li>The <code>elm_scroller</code> is a UI component and an implementation of a scrollable interface at the same time. The following functions can be used for all UI components which implement a scrollable interface, such as <code>elm_entry</code> and <code>elm_genlist</code>:
<ul>
<li><code>elm_scroller_region_show()</code></li>
<p>In addition to the possibilities provided by the <strong>Resource Manager</strong> view, you can use Edje to provide sets of alternative images in your application.</p>
-<p>The image set elements are used to display a specific image on the screen based on the container size. The image set is used to control the resource quality when the image part is scaled to multiple devices. According to the size of the part's container, an appropriate image is loaded.</p>
+<p>The image set elements are used to display a specific image on the screen depending on the container size. The image set is used to control the resource quality when the image part is scaled to multiple devices. According to the size of the part's container, an appropriate image is loaded.</p>
<p>The image sets can have the following properties:</p>
<ul><li><code>image: image-name</code>
<p>To make a layout scalable with UI components, the UI components must be packed into a container using only the weight and align properties based on their minimum size. Do not resize the UI components directly using pixels.</p>
-<p>The weight and align properties are associated with every elementary UI component, and they serve as hints for the container they are in. They tell the container how the UI component wants to occupy the space and pack itself with other UI components in the container.</p>
+<p>The weight and align properties are associated with every Elementary UI component, and they serve as hints for the container they are in. They tell the container how the UI component wants to occupy the space and pack itself with other UI components in the container.</p>
<h4>Weight</h4>
<p>The default value is <code>0.5 0.5</code>.</p></li>
<li><code>rel1</code>/<code>rel2</code>
-<p>Specifies the position of the left-top and bottom-right corners of the part's container.</p>
+<p>Specifies the position of the top left and bottom right corners of the part's container.</p>
<ul><li><code>relative</code>: X-axis Y-axis
<p>Specifies the relative position of the part's container.</p>
<p>The default value is <code>0.0 0.0</code> for <code>rel1.relative</code> and <code>1.0 1.0</code> for <code>rel2.relative</code>.</p></li>
<p>In Tizen, the application generally fills out the screen. However, sometimes you want the application to be shown in a specific aspect ratio, regardless of the screen size.</p>
<p>As images are scaled on different devices, they are resized based on the container size. The images have specific properties that define the area to be shown when resized.</p>
-<p>For example, the following table illustrates what happens to the parts marked with yellow rectangles in the following figure, when scaling properties are applied. in the table, the red dashed rectangle illustrates the container size.</p>
+<p>For example, the following table illustrates what happens to the parts marked with yellow rectangles in the following figure when scaling properties are applied. In the table, the red dashed rectangle illustrates the container size.</p>
<p align="center"><strong>Figure: Original image [1920x1280 (8:5)]</strong></p>
<p align="center"> <img alt="Original image [1920x1280 (8:5)]" src="../../../images/scale_original_image.png" /> </p>
</tbody></table>
<h3>Setting the Image Aspect Ratio</h3>
-<p>In case of an image object, you can set its aspect ratio with additional functions:</p>
+<p>You can set the aspect ratio of an image object with additional functions:</p>
<ul><li><code>elm_image_fill_outside_set()</code>
<p>If the second function parameter is set to <code>TRUE</code>, the image resizes to fill the entire area while keeping its aspect ratio. It lets the extra width or height go outside of the area (same result as with the aspect NONE in the above table).</p></li>
<p>You can implement your application to recognize and react to different types of gestures provided by the EFL library.</p>
-<p>The elementary library provides a gesture layer for a wide range of touch gestures, such as tap, double tap, triple tap, long tap, momentum monitoring, line, flick, zoom, and rotate, which can be used by the application to build a dynamic user interface interaction which is simple and intuitive to use.</p>
+<p>The Elementary library provides a gesture layer for a wide range of touch gestures, such as tap, double tap, triple tap, long tap, momentum monitoring, line, flick, zoom, and rotate, which can be used by the application to build a dynamic user interface interaction which is simple and intuitive to use.</p>
<h2 id="initial" name="initial">Initializing Touch Gestures</h2>
</li>
<li>
<p>Create a new gesture layer with the <code>elm_gesture_layer_add()</code> function.</p>
-<p>The <code>elm_gesture_layer_attach()</code> function attaches a given gesture layer to an <code>Evas_Object</code>. This object listens to all mouse and key events, and reports the gestures made upon it.</p>
+<p>The <code>elm_gesture_layer_attach()</code> function attaches a given gesture layer to an <code>Evas_Object</code>. This object listens for all mouse and key events, and reports the gestures made upon it.</p>
<pre class="prettyprint">
/* Gesture layer object */
g = elm_gesture_layer_add(win);
</pre>
</li>
<li>
-<p>When the mouse up event occurs and the <strong>Ctrl</strong> key up signal is detected (in case of zooming with a mouse wheel and <strong>Ctrl</strong> key), the <code>zoom_end()</code> callback function is called:</p>
+<p>When the mouse up event occurs and the <strong>Ctrl</strong> key up signal is detected (when the user zooms using the mouse wheel and <strong>Ctrl</strong> key), the <code>zoom_end()</code> callback function is called:</p>
<pre class="prettyprint">
static Evas_Event_Flags
zoom_end(void *data, void *event_info)
<p>This feature is supported in mobile applications only.</p>
-<p>The UI components are mobile-friendly: for example, the naviframe container component supports multiple view management, the entry component supports various modes (such as password, single-line or multi-line, edit or no-edit), the index component supports fast access to another group of UI items, and the toolbar component shows a menu when an item is selected.</p>
+<p>The UI components are mobile-friendly: for example, the naviframe container component supports multiple view management, the entry component supports various modes (such as password, single-line or multi-line, edit or no-edit), the index component supports quick access to another group of UI items, and the toolbar component shows a menu when an item is selected.</p>
<p>The mobile UI components are designed to allow the user to interact with touch screen-equipped mobile devices. Therefore, when developing mobile applications, you can easily use them through the mobile-related infrastructure in company with view management, and when reacting to touch events and the user finger size.</p>
<p align="center" class="Table"><strong>Table: Available UI components</strong></p>
</tr>
<tr>
<td><a href="component_index_mn.htm">Index</a></td>
- <td>The index component provides an index for fast access to another group of UI items.</td>
+ <td>The index component provides an index for quick access to another group of UI items.</td>
</tr>
<tr>
<td><a href="component_segmentcontrol_mn.htm">Segmentcontrol</a></td>
</tr>
<tr>
<td><a href="component_panel_mn.htm">Panel</a></td>
- <td>The panel component is an animated object that can contain child objects. It can be expanded or contracted by clicking the button on its edge.</td>
+ <td>The panel component is an animated object that can contain child objects. It can be expanded or collapsed by clicking the button on its edge.</td>
</tr>
<tr>
<td><a href="component_list_mn.htm">List</a></td>
</tr>
<tr>
<td><a href="component_photocam_mn.htm">Photocam</a></td>
- <td>The photocam component is designed to display high-resolution photos taken with a digital camera. It allows you to zoom photos, load photos fast, and fit photos. It is optimized for JPEG images and has a low memory footprint.</td>
+ <td>The photocam component is designed to display high-resolution photos taken with a digital camera. It allows you to zoom photos, load photos quickly, and fit photos. It is optimized for JPEG images and has a low memory footprint.</td>
</tr>
<tr>
<td rowspan="10">User input</td>
</li>
<li><a href="ui_scalability_n.htm">Scaling</a>
- <p>To ensure that your application works well in diverse devices, you must consider scalability when designing the application layout.</p>
+ <p>To ensure that your application works well on diverse devices, you must consider scalability when designing the application layout.</p>
</li>
</ul>
<tr>
<td>Navigation elements</td>
<td><a href="component_index_wn.htm">Index</a></td>
- <td>The index component provides an index for fast access to another group of UI items.</td>
+ <td>The index component provides an index for quick access to another group of UI items.</td>
</tr>
<tr>
<td rowspan="8">Presentation views</td>
</tr>
<tr>
<td><a href="component_circ_object_wn.htm">Circle Object</a></td>
- <td>The circle object extends elementary components in a form of circular design. Sometimes, a circle object merely provides additional UI features for the elementary component, and sometimes it works as an independent component with its own UI and functionalities.
+ <td>The circle object extends Elementary components in a form of circular design. Sometimes, a circle object merely provides additional UI features for the Elementary component, and sometimes it works as an independent component with its own UI and functionalities.
<p>Circular components can usually be added with the <code>eext_circle_object_[component_name]_add()</code> function, which returns a circle object handle. Circular components are shown in a form of an arch with radius, line width, and color. These properties can be set with the <code>eext_circle_object_item_XXX()</code> functions. The circle object can also take a rotary event. Generally, a clockwise rotary event increases the value of the rotary event activated by the circle object, and a counter-clockwise rotary event decreases the value.</p></td>
</tr>
<tr>
<ul>
<li>Image sets
-<p>If the application is potentially used at different resolutions, use image sets to provide separate image files for different resolutions. For example, in case of the button defined above, consider having 2 different image files for the <code>bg.png</code> background image. Change the <code>images</code> block in the above code to contain an image set named <code>bg.png</code> instead of a single image file:</p>
+<p>If the application is potentially used at different resolutions, use image sets to provide separate image files for different resolutions. For the button defined above, consider having 2 different image files for the <code>bg.png</code> background image. Change the <code>images</code> block in the above code to contain an image set named <code>bg.png</code> instead of a single image file:</p>
<ul>
<li>Use the <code>bg_low.png</code> image file when the size of the image is under 200 px.</li>
<li>Use the <code>bg_high.png</code> image file for higher resolutions.</li>
app.broadcastTrustedEvent(appEvent, data);
</pre>
</li>
-<li>The second application can listen for the first application and receive data.
+<li>The second application can listen to the first application and receive data.
<p>To receive data from the first application, use the <code>addEventListener()</code> method with the sender application ID and event name:</p>
<pre class="prettyprint">
var app = tizen.application.getCurrentApplication();
<div class="note">
<strong>Note</strong>
- To guarantee that a Web application runs in the background, at least one <code>background-category</code> element must be declared in the <code>config.xml</code> file (in <a href="../../../../org.tizen.studio/html/web_tools/config_editor_w.htm#mw_bg_category">mobile</a> and <a href="../../../../org.tizen.studio/html/web_tools/config_editor_w.htm#ww_bg_category">wearable</a> applications), and the <code>background-support</code> attribute of the <code><tizen:setting></code> element must be set to <code>enable</code>.
+ To guarantee that a Web application runs in the background, at least 1 <code>background-category</code> element must be declared in the <code>config.xml</code> file (in <a href="../../../../org.tizen.studio/html/web_tools/config_editor_w.htm#mw_bg_category">mobile</a> and <a href="../../../../org.tizen.studio/html/web_tools/config_editor_w.htm#ww_bg_category">wearable</a> applications), and the <code>background-support</code> attribute of the <code><tizen:setting></code> element must be set to <code>enable</code>.
</div>
<p>The following <code>config.xml</code> file example shows how an application can be configured to run in the background:</p>
<ul>
<li>Managing badges
<p>You can <a href="#manage">set and get the badge number</a>.</p></li>
- <li>Listening to badge changes
+ <li>Listening for badge changes
<p>You can <a href="#receive">receive notifications on badge changes</a> to display and react to badges.</p></li>
</ul>
<div id="container"><div id="contents"><div class="content">
<h1>Applications</h1>
-<p>The <a href="../../../../org.tizen.studio/html/cover_page.htm">Tizen Studio</a> enables you to create Web applications for mobile and wearable devices. A Web application comprises HTML, JavaScript, and CSS combined in a package, which can be installed on the Tizen device. A <a href="../../../../org.tizen.training/html/web/process/app_dev_process_w.htm#package">Web application package</a> includes all the support files that are needed by the Web application. Therefore, a Web application can run without any additional external resources or network connectivity after installation.</p>
+<p>The <a href="../../../../org.tizen.studio/html/cover_page.htm">Tizen Studio</a> enables you to create Web applications for mobile and wearable devices. A Web application consists of HTML, JavaScript, and CSS combined in a package, which can be installed on the Tizen device. A <a href="../../../../org.tizen.training/html/web/process/app_dev_process_w.htm#package">Web application package</a> includes all the support files that are needed by the Web application. Therefore, a Web application can run without any additional external resources or network connectivity after installation.</p>
<p>The Application API is mandatory for both Tizen mobile and wearable profiles, which means that it is supported in all mobile and wearable devices. All mandatory APIs are supported on the Tizen Emulators.</p>
</tr>
<tr>
<td><code>http://tizen.org/appcontrol/data/text</code></td>
- <td>The text to search. This key must be passed as a string.</td>
+ <td>The text to search for. This key must be passed as a string.</td>
<td>This key is mandatory.</td>
</tr>
</tbody>
<h4>MIME Type</h4>
<ul>
<li><code>application/vnd.tizen.calendar</code>
- <p>In case of viewing an event by an event ID, the event ID (ID in the <code>_calendar_event</code> view) extra data and <code>application/vnd.tizen.calendar</code> MIME type must be specified.</p>
+ <p>When viewing an event by event ID, the event ID (ID in the <code>_calendar_event</code> view) extra data and <code>application/vnd.tizen.calendar</code> MIME type must be specified.</p>
</li>
<li><code>text/x-vcalendar</code> (for vcalendar file)</li>
<li><code>text/vcalendar</code> (for vcalendar file)</li>
<h4>MIME Type</h4>
<ul>
<li><code>application/vnd.tizen.contact</code>
- <p>In case of viewing a contact by a person ID, the person ID (ID in the <code>_contact_person</code> view) extra data and <code>application/vnd.tizen.contact</code> MIME type must be specified.</p>
+ <p>When viewing a contact by person ID, the person ID (ID in the <code>_contact_person</code> view) extra data and <code>application/vnd.tizen.contact</code> MIME type must be specified.</p>
</li>
<li><code>text/vcard</code></li>
<li><code>text/x-vcard</code></li>
<h4>MIME Type</h4>
<p>Any MIME type that your application needs, such as <code>image/jpg</code>, <code>video/*</code>, or <code>*/*</code></p>
- <p>In case of sharing a single item through <code>http://tizen.org/appcontrol/data/path</code> and URI specified with <code>mailto:</code>, the MIME type must be explicitly set. </p>
+ <p>When sharing a single item through <code>http://tizen.org/appcontrol/data/path</code> and the URI is specified with <code>mailto:</code>, the MIME type must be explicitly set. </p>
<h4>Extra Input</h4>
<table>
<tbody>
<h4>MIME Type</h4>
<p>Any MIME type that your application needs, such as <code>image/jpg</code>, <code>video/*</code>, or <code>*/*</code></p>
- <p>In case of sharing a single item through <code>http://tizen.org/appcontrol/data/path</code> and URI specified with <code>mmsto:</code>, the MIME type must be explicitly set.</p>
+ <p>When sharing a single item through <code>http://tizen.org/appcontrol/data/path</code> and the URI is specified with <code>mmsto:</code>, the MIME type must be explicitly set.</p>
<h4>Extra Input</h4>
<table>
<tbody>
<div id="container"><div id="contents"><div class="content">
<h1>Service Application</h1>
-<p>A service application is a type of Tizen Web application that provides an environment for running JavaScript in the background without a graphical user interface (the application follows the <a href="http://www.ecma-international.org/publications/standards/Ecma-262.htm" target="_blank">ECMA-262 specification</a>). The service application is used to perform tasks which need to run periodically or continuously but do not require user interaction. For example, a service application can be used for getting data or listening to platform events in the background. As service applications do not have UI components, they run on top of a more light-weight runtime than UI applications. Therefore, you can expect them to perform better and consume less memory.</p>
+<p>A service application is a type of Tizen Web application that provides an environment for running JavaScript in the background without a graphical user interface (the application follows the <a href="http://www.ecma-international.org/publications/standards/Ecma-262.htm" target="_blank">ECMA-262 specification</a>). The service application is used to perform tasks which need to run periodically or continuously but do not require user interaction. For example, a service application can be used for getting data or listening for platform events in the background. As service applications do not have UI components, they run on top of a more light-weight runtime than UI applications. Therefore, you can expect them to perform better and consume less memory.</p>
<p>This feature is supported in wearable applications only. The Web service application is an optional feature, which means that it may not be supported on all wearable devices.</p>
<p>To enable your application to use the service application functionality:</p>
<ol>
-<li>To make your application visible only for devices that support the Web Service Application, the application must specify the following feature in the <code>config.xml</code> file:
+<li>To make your application visible only for devices that support the Web service application, the application must specify the following feature in the <code>config.xml</code> file:
<pre class="prettyprint">
<widget>
<tizen:feature name="http://tizen.org/feature/web.service"/>
<li><a href="#prerequisites">Prerequisites</a></li>
<li><a href="#Managing_BT_Adapter">Managing the Local Bluetooth Adapter</a></li>
<li><a href="#Discovering_BT_Devices">Discovering Bluetooth Devices</a></li>
- <li><a href="#Creating_Bond">Creating a Bonding with a Bluetooth Device</a></li>
+ <li><a href="#Creating_Bond">Creating a Bond with a Bluetooth Device</a></li>
<li><a href="#Connecting_BT_device">Connecting to and Exchanging Data with a Bluetooth Device</a></li>
<li><a href="#Communicating_Health">Communicating with a Health Source Device</a></li>
<li>Bluetooth Low Energy
<p>You can <a href="#Managing_BT_Adapter">enable and disable the local Bluetooth adapter</a>, and change the device name for it.</p></li>
<li>Discovering devices
<p>You can <a href="#Discovering_BT_Devices">discover other Bluetooth devices</a>.</p></li>
- <li>Creating a bonding with a Bluetooth device
- <p>You can <a href="#Creating_Bond">create a bonding</a> with another device retrieved through the discovery process. The bonding allows the 2 devices to establish a connection.</p> </li>
+ <li>Creating a bond with a Bluetooth device
+ <p>You can <a href="#Creating_Bond">create a bond</a> with another device retrieved through the discovery process. Bonding allows the 2 devices to establish a connection.</p> </li>
<li>Connecting to and exchanging data with a Bluetooth device
<p>You can <a href="#Connecting_BT_device">connect to and exchange data with a remote Bluetooth device</a>.</p></li>
<li>Communicating with a health source device
- <p>The Health Device Profile defines the requirements for the Bluetooth health device implementation. In the profile, there are 2 device type: one device is a source, such as a blood pressure monitor or pulse oximeter, while the other is a sink, such as a mobile phone or laptop. You can use your device as a sink and <a href="#Communicating_Health">communicate with a health source device</a>.</p> </li>
+ <p>The Health Device Profile defines the requirements for the Bluetooth health device implementation. In the profile, there are 2 device types: one device is a source, such as a blood pressure monitor or pulse oximeter, while the other is a sink, such as a mobile phone or laptop. You can use your device as a sink and <a href="#Communicating_Health">communicate with a health source device</a>.</p> </li>
</ul>
<p>The main Bluetooth (4.0) Low Energy features include:</p>
</pre></li>
</ol>
- <h2 id="Creating_Bond" name="Creating_Bond">Creating a Bonding with a Bluetooth Device</h2>
+ <h2 id="Creating_Bond" name="Creating_Bond">Creating a Bond with a Bluetooth Device</h2>
- <p>To create a bonding with other Bluetooth devices:</p>
+ <p>To create a bond with a Bluetooth device:</p>
<ol>
<li>Retrieve a <code>BluetoothAdapter</code> object (in <a href="../../../../org.tizen.web.apireference/html/device_api/mobile/tizen/bluetooth.html#BluetoothAdapter">mobile</a> and <a href="../../../../org.tizen.web.apireference/html/device_api/wearable/tizen/bluetooth.html#BluetoothAdapter">wearable</a> applications) with the <code>getDefaultAdapter()</code> method:
<pre class="prettyprint">
var adapter = tizen.bluetooth.getDefaultAdapter();
</pre></li>
- <li><p>To create a bonding with another device, use the <code>createBonding()</code> method:</p>
+ <li><p>To create a bond with another device, use the <code>createBonding()</code> method:</p>
<pre class="prettyprint">
function onBondingSuccessCallback(device) {
console.log('A bond is created - name: ' + device.name);
</div>
</li>
- <li><p>To end the bonding with a remote device, use the <code>destroyBonding()</code> method:</p>
+ <li><p>To end the bond with a remote device, use the <code>destroyBonding()</code> method:</p>
<pre class="prettyprint">
adapter.destroyBonding('35:F4:59:D1:7A:03');
</pre></li>
<p>When the service has been successfully registered, the <code>BluetoothServiceSuccessCallback</code> interface (in <a href="../../../../org.tizen.web.apireference/html/device_api/mobile/tizen/bluetooth.html#BluetoothServiceSuccessCallback">mobile</a> and <a href="../../../../org.tizen.web.apireference/html/device_api/wearable/tizen/bluetooth.html#BluetoothServiceSuccessCallback">wearable</a> applications) is triggered.</p> </li>
- <li>Before establishing a connection, your device must be bonded with a peer device. For more information, see <a href="#Creating_Bond">Creating a Bonding with a Bluetooth Device</a>.</li>
+ <li>Before establishing a connection, your device must be bonded with a peer device. For more information, see <a href="#Creating_Bond">Creating a Bond with a Bluetooth Device</a>.</li>
<li><p>To connect to the server device, use the <code>connectToServiceByUUID()</code> method on the client device:</p>
<pre class="prettyprint">
healthProfileHandler.registerSinkApplication(4100, 'testSinkApp', onSinkApp);
</pre>
<p>When the sink application is registered successfully, the <code>BluetoothHealthApplicationSuccessCallback</code> interface (in <a href="../../../../org.tizen.web.apireference/html/device_api/mobile/tizen/bluetooth.html#BluetoothHealthApplicationSuccessCallback">mobile</a> and <a href="../../../../org.tizen.web.apireference/html/device_api/wearable/tizen/bluetooth.html#BluetoothHealthApplicationSuccessCallback">wearable</a> applications) is invoked and you can get the registered sink application object.</p></li>
-<li>Before establishing a connection, your device must be bonded with a health source device. For more information, see <a href="#Creating_Bond">Creating a Bonding with a Bluetooth Device</a>.</li>
+<li>Before establishing a connection, your device must be bonded with a health source device. For more information, see <a href="#Creating_Bond">Creating a Bond with a Bluetooth Device</a>.</li>
<li><p>To connect to the health source device, use the <code>connectToSource()</code> method of the <code>BluetoothHealthProfileHandler</code> interface:</p>
<pre class="prettyprint">
function onConnect(channel) {
query['filter'] = {openstate: 'open'}
resource.methodPut(representation, onresponse, query, onerror);
</pre>
-<p>After a successful request, the <code>onresponse</code> callback is called with the result and updated resource representation. In case of a failure, the (optional) <code>onerror</code> callback is called.</p>
+<p>After a successful request, the <code>onresponse</code> callback is called with the result and updated resource representation. On a failure, the (optional) <code>onerror</code> callback is called.</p>
</li>
</ol>
</application>
</pre>
<ul><li>The <code>application</code> element must contain a <code>name</code> attribute with an application name.</li>
-<li>The <code>application</code> element must contain one or more <code>wallet</code> element, each of which must contain one or more <code>aid-group</code> element. </li>
+<li>The <code>application</code> element must contain 1 or more <code>wallet</code> elements, each of which must contain 1 or more <code>aid-group</code> elements. </li>
<li>The <code>aid-group</code> element is required to contain a <code>category</code> attribute with the <code>payment</code> or <code>other</code> value.</li>
-<li>Each <code>aid-group</code> element must contain one or more <code>aid</code> element, each of which contains a single AID. The <code>aid-group</code> can have as many <code>aid</code> elements as you want.</li>
+<li>Each <code>aid-group</code> element must contain 1 or more <code>aid</code> elements, each of which contains a single AID. The <code>aid-group</code> can have as many <code>aid</code> elements as you want.</li>
<li>The <code>aid</code> element must contain the <code>aid</code>, <code>se_type</code>, <code>unlock</code>, and <code>power</code> attributes.</li>
<li>The <code>se_type</code> attribute must contain <code>hce</code>, <code>ese</code>, or <code>uicc</code>. The <code>se_type</code> value can be added later.</li>
<li>The <code>unlock</code> attribute must contain one of the following:
<li>The system sends the <code>http://tizen.org/appcontrol/operation/nfc/card_emulation/default_changed</code> application control event when the default wallet is changed. For example, in <strong>Setting > NFC > Set Default Wallet App</strong>, if the default wallet is changed, an application control with this operation is sent to the selected application (wallet).</li>
</ul>
-<p>The following table lists the NFC operations, URI scheme and mime.</p>
+<p>The following table lists the NFC operations, URI scheme and MIME.</p>
<p align="center" class="Table"><strong>Table: NFC operations</strong></p>
<table border="1">
<tbody>
<h2 id="tracking_progress">Tracking Transfer Progress</h2>
-<p>To track the progress of a file transfer, the <code>FileTransfer</code> object (in <a href="../../../../org.tizen.web.apireference/html/device_api/mobile/tizen/cordova/filetransfer.html#FileTransfer">mobile</a>, <a href="../../../../org.tizen.web.apireference/html/device_api/wearable/tizen/cordova/filetransfer.html#FileTransfer">wearable</a>, and <a href="../../../../org.tizen.web.apireference/html/device_api/tv/tizen/cordova/filetransfer.html#FileTransfer">TV</a> applications) has the <code>onprogress</code> property, which is used to set up a function invoked each time a chunk of data is transferred. As a parameter, the function gets a <code>ProgressEvent</code> object (in <a href="../../../../org.tizen.web.apireference/html/device_api/mobile/tizen/cordova/file.html#ProgressEvent">mobile</a>, <a href="../../../../org.tizen.web.apireference/html/device_api/wearable/tizen/cordova/file.html#ProgressEvent">wearable</a>, and <a href="../../../../org.tizen.web.apireference/html/device_api/tv/tizen/cordova/file.html#ProgressEvent">TV</a> applications).</p>
+<p>To track the progress of a file transfer, the <code>FileTransfer</code> object (in <a href="../../../../org.tizen.web.apireference/html/device_api/mobile/tizen/cordova/filetransfer.html#FileTransfer">mobile</a>, <a href="../../../../org.tizen.web.apireference/html/device_api/wearable/tizen/cordova/filetransfer.html#FileTransfer">wearable</a>, and <a href="../../../../org.tizen.web.apireference/html/device_api/tv/tizen/cordova/filetransfer.html#FileTransfer">TV</a> applications) has the <code>onprogress</code> property, which is used to set up a method invoked each time a chunk of data is transferred. As a parameter, the method gets a <code>ProgressEvent</code> object (in <a href="../../../../org.tizen.web.apireference/html/device_api/mobile/tizen/cordova/file.html#ProgressEvent">mobile</a>, <a href="../../../../org.tizen.web.apireference/html/device_api/wearable/tizen/cordova/file.html#ProgressEvent">wearable</a>, and <a href="../../../../org.tizen.web.apireference/html/device_api/tv/tizen/cordova/file.html#ProgressEvent">TV</a> applications).</p>
<p>To track the progress of a transfer:</p>
<pre class="prettyprint">
/* Valid URL needed, such as cdvfile://localhost/persistent/path/to/file.txt */
<p> Learning how to use sorting modes allows you effectively incorporate query methods in your application:</p>
<ol>
- <li><p>The <code>SortMode</code> interface (in <a href="../../../../org.tizen.web.apireference/html/device_api/mobile/tizen/tizen.html#SortMode">mobile</a>, <a href="../../../../org.tizen.web.apireference/html/device_api/wearable/tizen/tizen.html#SortMode">wearable</a>, and <a href="../../../../org.tizen.web.apireference/html/device_api/tv/tizen/tizen.html#SortMode">TV</a> applications) is created to sort the search results. In this example, it is used to sort contacts in the device address book in ascending order, based on their first name.</p>
+ <li><p>The <code>SortMode</code> interface (in <a href="../../../../org.tizen.web.apireference/html/device_api/mobile/tizen/tizen.html#SortMode">mobile</a>, <a href="../../../../org.tizen.web.apireference/html/device_api/wearable/tizen/tizen.html#SortMode">wearable</a>, and <a href="../../../../org.tizen.web.apireference/html/device_api/tv/tizen/tizen.html#SortMode">TV</a> applications) is created to sort the search results. In this example, it is used to sort contacts in the device address book in ascending order by first name.</p>
<p>Create the sort order with the <code>SortMode()</code> method. Specify an attribute name to sort by and an order option.</p>
<pre class="prettyprint">
/* Use the firstName attribute with an ASC order */
<p>Learning how to use filters allows you effectively incorporate complex query methods in your application. You can create queries using AND and OR conditions, like in SQL queries. The following example shows how to make the following query:</p>
<p><code>"where ((type='VIDEO' OR type='IMAGE') AND title like '%special%')"</code></p>
- <p>Basically, you search in the content of the device for media items where the media type is video or image, and the title contains the word "special".</p>
+ <p>Basically, you search the content of the device for media items where the media type is video or image, and the title contains the word "special".</p>
<ol>
<li> <p>Create attribute filters to include all content whose media type is either video or image:</p>
<pre class="prettyprint">
/* Search for the storages */
tizen.filesystem.listStorages(checkCorruptedRemovableDrives);
</pre></li>
- <li> <p>To get storage details based on the storage name (the <code>label</code> attribute), use the <code>getStorage()</code> method.</p> <p>The success callback receives the <code>FileSystemStorage</code> object containing the storage details as an input parameter.</p>
+ <li> <p>To get storage details by storage name (the <code>label</code> attribute), use the <code>getStorage()</code> method.</p> <p>The success callback receives the <code>FileSystemStorage</code> object containing the storage details as an input parameter.</p>
<pre class="prettyprint">
/* Success event handler */
function onStorage(storage) {
</ol>
<h2 id="receive" name="receive">Receiving Notifications on Content Changes</h2>
-<p>You can receive notifications when a content item is added, updated, or deleted. The <code>setChangeListener()</code> method of the <code>ContentManager</code> interface (in <a href="../../../../org.tizen.web.apireference/html/device_api/mobile/tizen/content.html#ContentManager">mobile</a>, <a href="../../../../org.tizen.web.apireference/html/device_api/wearable/tizen/content.html#ContentManager">wearable</a>, and <a href="../../../../org.tizen.web.apireference/html/device_api/tv/tizen/content.html#ContentManager">TV</a> applications) registers a change listener. You can use the <code>ContentChangeCallback</code> interface (in <a href="../../../../org.tizen.web.apireference/html/device_api/mobile/tizen/content.html#ContentChangeCallback">mobile</a>, <a href="../../../../org.tizen.web.apireference/html/device_api/wearable/tizen/content.html#ContentChangeCallback">wearable</a>, and <a href="../../../../org.tizen.web.apireference/html/device_api/tv/tizen/content.html#ContentChangeCallback">TV</a> applications) to define listener event handlers for receiving the notifications.</p>
+<p>You can receive notifications when a content item is added, updated, or deleted. The <code>addChangeListener()</code> method of the <code>ContentManager</code> interface (in <a href="../../../../org.tizen.web.apireference/html/device_api/mobile/tizen/content.html#ContentManager">mobile</a>, <a href="../../../../org.tizen.web.apireference/html/device_api/wearable/tizen/content.html#ContentManager">wearable</a>, and <a href="../../../../org.tizen.web.apireference/html/device_api/tv/tizen/content.html#ContentManager">TV</a> applications) registers a change listener. You can use the <code>ContentChangeCallback</code> interface (in <a href="../../../../org.tizen.web.apireference/html/device_api/mobile/tizen/content.html#ContentChangeCallback">mobile</a>, <a href="../../../../org.tizen.web.apireference/html/device_api/wearable/tizen/content.html#ContentChangeCallback">wearable</a>, and <a href="../../../../org.tizen.web.apireference/html/device_api/tv/tizen/content.html#ContentChangeCallback">TV</a> applications) to define listener event handlers for receiving the notifications.</p>
<p>To receive notifications when content items are added, updated, or removed:</p>
<ol>
<div class="note">
<strong>Note</strong>
- Do not use the <code>code</code> attribute of the <code>WebAPIException</code> interface to distinguish errors, because the code of the exception object is set to <code>0</code> in case of new error types that are not defined in <a href="http://www.w3.org/TR/dom/#domexception" target="_blank">DOMException</a>.
+ Do not use the <code>code</code> attribute of the <code>WebAPIException</code> interface to distinguish errors, because the code of the exception object is set to <code>0</code> for new error types that are not defined in <a href="http://www.w3.org/TR/dom/#domexception" target="_blank">DOMException</a>.
</div>
</li>
<li>Generic event handling
<div class="note">
<strong>Note</strong>
- The feature support differs based on the application profile (mobile or wearable). For a complete list of APIs and their supported profiles, see <a href="../../../org.tizen.web.apireference/html/web_api_reference.htm">Web API References</a>.
+ The feature support differs depending on the application profile (mobile, wearable, or TV). For a complete list of APIs and their supported profiles, see <a href="../../../org.tizen.web.apireference/html/web_api_reference.htm">Web API References</a>.
</div>
<p>Select the feature you are interested in and see what Tizen offers for your application:</p>
<strong>Note</strong>
In Tizen Web Device APIs, there are 2 types of APIs: mandatory and optional.
<p>The mandatory APIs are always available on all Tizen devices. The optional APIs provide functionality that depends on the available device hardware or software capabilities, and they may not be available on all Tizen devices. For example, the Bluetooth and NFC API hardware features are optional, and not supported on all devices.</p>
-<p>To determine the availability of optional APIs, use the <code>tizen.systeminfo.getCapability()</code> method of the System Information API (in <a href="../../../org.tizen.web.apireference/html/device_api/mobile/tizen/systeminfo.html#SystemInfo">mobile</a> and <a href="../../../org.tizen.web.apireference/html/device_api/wearable/tizen/systeminfo.html#SystemInfo">wearable</a> applications).</p>
+<p>To determine the availability of optional APIs, use the <code>tizen.systeminfo.getCapability()</code> method of the System Information API (in <a href="../../../org.tizen.web.apireference/html/device_api/mobile/tizen/systeminfo.html#SystemInfo">mobile</a>, <a href="../../../org.tizen.web.apireference/html/device_api/wearable/tizen/systeminfo.html#SystemInfo">wearable</a>, and <a href="../../../org.tizen.web.apireference/html/device_api/tv/tizen/systeminfo.html#SystemInfo">TV</a> applications).</p>
<p>Note that all mandatory APIs are supported on the Tizen Emulators, while the optional APIs may or may not be supported. For more information on support for each API, see <a href="../../../org.tizen.web.apireference/html/device_api/device_api_cover.html">Tizen Web Device API Reference</a>.</p>
</div>
You can register only 1 media key state change listener for your application. If you attempt to register a second listener, the first listener is unset and replaced with the new one.
</div>
</li>
- <li>Handling state changes<p>With the registered listener, you can monitor the media keys and react to their state changes, when the user presses or releases a key.</p> </li>
+ <li>Handling state changes<p>With the registered listener, you can monitor the media keys and react to their state changes when the user presses or releases a key.</p> </li>
</ul>
<h2 id="state" name="state">Managing Media Key State Changes</h2>
<ol>
<li>
-<p>To find a radio channel at a higher frequency than the current one, use the <code>seekUp()</code>method of the <a href="../../../../org.tizen.web.apireference/html/device_api/mobile/tizen/fmradio.html#FMRadioManager">FMRadioManager</a> interface. This function is available only in <code>PLAYING</code> radio state.</p>
+<p>To find a radio channel at a higher frequency than the current one, use the <code>seekUp()</code>method of the <a href="../../../../org.tizen.web.apireference/html/device_api/mobile/tizen/fmradio.html#FMRadioManager">FMRadioManager</a> interface. This method is available only in <code>PLAYING</code> radio state.</p>
<pre class="prettyprint">
if (tizen.fmradio.state === 'PLAYING') {
</li>
<li>
-<p>To find a radio channel at a lower frequency than the current one, use the <code>seekDown()</code>method of the <code>FMRadioManager</code> interface. This function is available only in <code>PLAYING</code> radio state.</p>
+<p>To find a radio channel at a lower frequency than the current one, use the <code>seekDown()</code>method of the <code>FMRadioManager</code> interface. This method is available only in <code>PLAYING</code> radio state.</p>
<pre class="prettyprint">
if (tizen.fmradio.state === 'PLAYING') {
</pre>
</li>
-<li>To scan all available radio channels, use the <code>scanStart()</code> method of the <code>FMRadioManager</code> interface. This function is available only in the <code>READY</code> state. During scanning, the state is changed to <code>SCANNING</code>.
+<li>To scan all available radio channels, use the <code>scanStart()</code> method of the <code>FMRadioManager</code> interface. This method is available only in the <code>READY</code> state. During scanning, the state is changed to <code>SCANNING</code>.
<pre class="prettyprint">
var radioScanCallback = {
onfrequencyfound: function(frequency) {
}
}
</pre>
-<p>In case you are sending MMS or email messages with attachments, add the attachments as an array of <a href="../../../../org.tizen.web.apireference/html/device_api/mobile/tizen/messaging.html#MessageAttachment">MessageAttachment</a> objects with the file path and the MIME type (<code>image/png</code>, <code>text/pdf</code>, or <code>text/html</code>) defined for each object.</p>
+<p>If sending MMS or email messages with attachments, add the attachments as an array of <a href="../../../../org.tizen.web.apireference/html/device_api/mobile/tizen/messaging.html#MessageAttachment">MessageAttachment</a> objects with the file path and the MIME type (<code>image/png</code>, <code>text/pdf</code>, or <code>text/html</code>) defined for each object.</p>
<p>Assign the array to the <code>attachments</code> attribute of the <code>Message</code> object.</p>
<h2 id="Synchronizing_with_the_Server" name="Synchronizing_with_the_Server">Synchronizing with the Server</h2>
-<p>To keep your email service accounts up-to-date, synchronize them with their respective external servers, such as Gmail and Microsoft Exchange, with the <code>sync()</code> method. You can also synchronize just one folder, such as the Inbox, with the <code>syncFolder()</code> method. You can specify the maximum number of messages that can be retrieved in each folder.</p>
+<p>To keep your email service accounts up-to-date, synchronize them with their respective external servers, such as Gmail and Microsoft Exchange, with the <code>sync()</code> method. You can also synchronize a single folder, such as the Inbox, with the <code>syncFolder()</code> method. You can specify the maximum number of messages that can be retrieved in each folder.</p>
<p>It is possible that an email message is accessible through the <a href="../../../../org.tizen.web.apireference/html/device_api/mobile/tizen/messaging.html#Message">Message</a> object, but its full body or attachment has not been downloaded yet. You can load email messages and attachments from the email service with the <code>loadMessageBody()</code> and <code>loadMessageAttachment()</code> methods of the <a href="../../../../org.tizen.web.apireference/html/device_api/mobile/tizen/messaging.html#MessageService">MessageService</a> interface. </p>
<p>Push notification helps your application server send data to the application on devices over network even if the application is not running. Push service can reduce battery consumption and data transfer.</p>
- <p>When a push message arrives when the application is running, it is automatically delivered to the application. If not, the push service makes a sound or vibrates, and adds a ticker or a badge notification to notify the user. By touching the notification, the user can check the message. The application server can send a message with a <code>LAUNCH</code> option. In this case, the push service forcibly launches the application and hands over the message to the application.</p>
-
+ <p>If a push message arrives when the application is running, the message is automatically delivered to the application. If the application is not running, the push service makes a sound or vibrates and adds a ticker or a badge notification to notify the user. By touching this notification, the user can check the message. If the application server sends a message with a <code>LAUNCH</code> option, the push service forcibly launches the application and hands over the message to the application.</p>
<p>The main features of the Push API include:</p>
<ul>
</ol>
<h2 id="GetPushMessage">Retrieving Messages When Launched by the Push Service</h2>
-<p>If the application is launched by the push service due to a notification, use the <code>getPushMessage()</code> method to return the last undelivered push message. If none exists, the function returns <code>NULL</code>.</p>
+<p>If the application is launched by the push service due to a notification, use the <code>getPushMessage()</code> method to return the last undelivered push message. If none exists, the method returns <code>NULL</code>.</p>
<p>To retrieve and read the last message:</p>
<p>You can <a href="#Creating_Calendar">create a new calendar</a> using the <code>addCalendar()</code> method of the <a href="../../../../org.tizen.web.apireference/html/device_api/mobile/tizen/calendar.html#CalendarManager">CalendarManager</a> interface (you also need the <a href="../../../../org.tizen.web.apireference/html/device_api/mobile/tizen/account.html">Account</a> API).</p>
</li>
<li>Calendar item management
- <p>You can manage calendar items (add a new <a href="#Adding_Events">event</a> or <a href="#Adding_Tasks">task</a> to a calendar, or manage a single calendar <a href="#Managing_Event">event</a> or <a href="#Managing_Task">task</a>) by using the applicable methods of the <a href="../../../../org.tizen.web.apireference/html/device_api/mobile/tizen/calendar.html#Calendar">Calendar</a> interface. You can also delete or <a href="#Updating_Event">update a single instance of a recurring event</a>.</p>
+ <p>You can manage calendar items (add a new <a href="#Adding_Events">event</a> or <a href="#Adding_Tasks">task</a> to a calendar, or manage a single calendar <a href="#Managing_Event">event</a> or <a href="#Managing_Task">task</a>) by using the applicable methods of the <a href="../../../../org.tizen.web.apireference/html/device_api/mobile/tizen/calendar.html#Calendar">Calendar</a> interface. You can also delete or <a href="#Updating_Event">update a single instance of a recurring event</a>.</p>
<p>When creating an important event or task, such as a monthly meeting or a task of paying a utility bill, you can set an alarm for it by using the <a href="../../../../org.tizen.web.apireference/html/device_api/mobile/tizen/calendar.html#CalendarAlarm">CalendarAlarm</a> interface. The alarm is triggered at a defined time to remind the user of the event or task.</p>
<p>You can create multiple <a href="#Adding_Events_Batch">events</a> or <a href="#Adding_Tasks_Batch">tasks</a>, and manage multiple calendar <a href="#Managing_Event_Batch">events</a> or <a href="#Managing_Task_Batch">tasks</a> simultaneously by using the applicable batch methods. The batch mode provides faster, optimized processing of multiple calendar items.</p>
eventExpandSuccessCB);
</pre>
<p>The expanded event instances have their own <code>id.uid</code> and <code>id.rid</code> attributes, where the <code>id.uid</code> attribute is the same for all instances.</p> </li>
- <li><p>Update a single instance of the expanded recurring event.</p> <p>In case of recurring events, you can use the second parameter of the <code>update()</code> method to determine whether a single instance or all occurrences of the event are updated. If the parameter is set to <code>true</code>, all instances are updated, while if it is set to <code>false</code>, only the indicated instance of the recurring event is updated (based on the <code>id.rid</code> attribute).</p> <p>In this example, the second instance of the event is updated.</p>
+ <li><p>Update a single instance of the expanded recurring event.</p> <p>For recurring events, you can use the second parameter of the <code>update()</code> method to determine whether a single instance or all occurrences of the event are updated. If the parameter is set to <code>true</code>, all instances are updated, while if it is set to <code>false</code>, only the indicated instance of the recurring event is updated (based on the <code>id.rid</code> attribute).</p> <p>In this example, the second instance of the event is updated.</p>
<pre class="prettyprint">
/* Success event handler */
function eventExpandSuccessCB(events) {
<h3 id="Converting_Event" name="Converting_Event">Converting Event Formats</h3>
<p>You can make event exchange more efficient in your application by converting an event to the iCalendar format (or back) using the <a href="../../../../org.tizen.web.apireference/html/device_api/mobile/tizen/calendar.html#CalendarEvent">CalendarEvent</a> object constructor and the <code>convertToString()</code> method of the <a href="../../../../org.tizen.web.apireference/html/device_api/mobile/tizen/calendar.html#CalendarItem">CalendarItem</a> interface.</p>
<p>The conversion allows you to exchange calendar data between applications by sharing files with the <code>.ics</code> extension. The iCalendar format is independent of the underlying transport protocol, meaning that calendar items can be exchanged using a variety of transports, including HTTP, SMTP, and Infrared. The iCalendar format can be used to store calendar item information and exchange calendar data over the Internet.</p>
-<p>The following example shows a sample event in the iCalendar format:</p>
+<p>The following example shows a sample event in iCalendar format:</p>
<pre class="prettyprint">
BEGIN:VCALENDAR
BEGIN:VEVENT
<h3 id="Converting_Task" name="Converting_Task">Converting Task Formats</h3>
<p>You can make task exchange more efficient in your application by converting a task to the iCalendar format (or back) using the <a href="../../../../org.tizen.web.apireference/html/device_api/mobile/tizen/calendar.html#CalendarTask">CalendarTask</a> object constructor and the <code>convertToString()</code> method of the <a href="../../../../org.tizen.web.apireference/html/device_api/mobile/tizen/calendar.html#CalendarItem">CalendarItem</a> interface.</p>
<p>The conversion allows you to exchange calendar data between applications by sharing files with the <code>.ics</code> extension. The iCalendar format is independent of the underlying transport protocol, meaning that calendar items can be exchanged using a variety of transports, including HTTP, SMTP, and Infrared. The iCalendar format can be used to store calendar item information and exchange calendar data over the Internet.</p>
-<p>The following example shows a sample task in the iCalendar format:</p>
+<p>The following example shows a sample task in iCalendar format:</p>
<pre class="prettyprint">
BEGIN:VCALENDAR
BEGIN:VTODO
<h1>Contacts</h1>
- <p>Tizen enables you to manage the contacts and persons listed in your address books. A <a href="../../../../org.tizen.web.apireference/html/device_api/mobile/tizen/contact.html#Contact">Contact</a> object is always associated with a specific address book. A <a href="../../../../org.tizen.web.apireference/html/device_api/mobile/tizen/contact.html#Person">Person</a> object is an aggregation of one or more contacts associated with the same person.</p>
+ <p>Tizen enables you to manage the contacts and persons listed in your address books. A <a href="../../../../org.tizen.web.apireference/html/device_api/mobile/tizen/contact.html#Contact">Contact</a> object is always associated with a specific address book. A <a href="../../../../org.tizen.web.apireference/html/device_api/mobile/tizen/contact.html#Person">Person</a> object is an aggregation of 1 or more contacts associated with the same person.</p>
<p>This feature is supported in mobile applications only.</p>
</pre></li>
</ol> </li>
<li>To get and reset the number of person's calls, messages, and emails:
- <p>You can get the total number of each person's calls, messages, and emails by using the <code>getUsageCount()</code> function. You can also reset the usage count of a person using the <code>resetUsageCount()</code> function of the <a href="../../../../org.tizen.web.apireference/html/device_api/mobile/tizen/contact.html#Person">Person</a> interface, which works in a synchronous mode. To reset the usage count for multiple persons, use the <code>resetUsageCountBatch()</code> function, which works in an asynchronous mode.</p>
+ <p>You can get the total number of each person's calls, messages, and emails by using the <code>getUsageCount()</code> method. You can also reset the usage count of a person using the <code>resetUsageCount()</code> method of the <a href="../../../../org.tizen.web.apireference/html/device_api/mobile/tizen/contact.html#Person">Person</a> interface, which works in a synchronous mode. To reset the usage count for multiple persons, use the <code>resetUsageCountBatch()</code> method, which works in an asynchronous mode.</p>
<ul>
<li><p>Retrieve the total number of calls, messages, and emails of a particular person:</p>
<pre class="prettyprint">
<h2 id="config" name="config">Web IME Configuration</h2>
- <p>The Web IME configuration follows the Tizen packaging policy with certain extensions. Tizen applications are packaged according to the <a href="http://www.w3.org/TR/widgets/" target="_blank">Widget packaging guidelines</a>. For more information on Tizen extensions to configuration elements, see <a href="../../../../org.tizen.studio/html/web_tools/config_editor_w.htm#elements">Configuration Elements</a> and <a href="../../../../org.tizen.studio/html/web_tools/config_editor_w.htm#ww_extend">Extending Configuration Elements</a>.</p>
+ <p>The Web IME configuration follows the Tizen packaging policy with certain extensions. Tizen applications are packaged according to the <a href="https://www.w3.org/TR/2011/REC-widgets-20110927/" target="_blank">Widget packaging guidelines</a>. For more information on Tizen extensions to configuration elements, see <a href="../../../../org.tizen.studio/html/web_tools/config_editor_w.htm#elements">Configuration Elements</a> and <a href="../../../../org.tizen.studio/html/web_tools/config_editor_w.htm#ww_extend">Extending Configuration Elements</a>.</p>
<p>Internally, the application package manager is responsible for installing, uninstalling, and updating packages and storing their information.</p>
<p>Tizen has the following additional configuration elements:</p>
<ul>
<p>The Web IME is capable of not only showing a soft keyboard and emitting key events to client application, but also handling hardware key events and translating them to a specific language. This is very common when typing texts in CJK (Chinese, Japanese, and Korean) languages, where each key event must be composed to produce a final result string.</p>
<p>When a hardware key is pressed, the client application receives the key event and requests the Input Service framework to translate the key event. The request is then delivered to the currently selected Web IME through the event handler.</p>
- <p>When creating the handler object for <code>WebHelperClient</code>, implement the <code>onProcessKeyEvent()</code> method in case you want to translate each hardware key event.</p>
+ <p>When creating the handler object for <code>WebHelperClient</code>, implement the <code>onProcessKeyEvent()</code> method if you want to translate each hardware key event.</p>
<p>The following example translates the key event to a string "ㅁ", which is a Korean character mapped to the <code>a</code> key event. </p>
<div class="note">
<strong>Note</strong>
- To provide a full support for Korean character composition, a more complex process is needed. This example is only a demonstration.
+ To provide full support for Korean character composition, a more complex process is needed. This example is only a demonstration.
</div>
<pre class="prettyprint">
<li>Time control
<p>You can use ease, duration, and delay.</p></li>
<li>Effect
- <p>Provides predefined effects. This means that you can use a fancy effect just by sting instead of specifying an animation value. Predefined effects are fully controlled in TAU Animation. You can also stop the animation.</p></li>
+ <p>Provides predefined effects. This means that you can use a fancy effect simply with a string instead of specifying an animation value. Predefined effects are fully controlled in TAU Animation. You can also stop the animation.</p></li>
<li>CSS animation
<p>Target objects can be animated using CSS styles, such as <code>backgroundColor</code>, <code>border</code>, <code>margin</code>, <code>padding</code>, and <code>shadow</code>. A CSS animation can also be controlled by TAU Animation.</p></li>
<li>HTML element-based animation (in future)
<p align="center"><strong>Figure: Animation parts</strong></p>
<p align="center"><img src="../../../images/tau_animation_1.png" alt="Animation parts" /></p>
<ul>
- <li>Ticker: Switches the <code>requestAnimationFrame()</code> method on and off. Ticker is operated based on events.</li>
+ <li>Ticker: Switches the <code>requestAnimationFrame()</code> method on and off. The ticker operates based on events.</li>
<li>TweenAnimator: Runs the whole time logic. The TweenAnimator invokes the animation to play or stop, and it also updates the tween value per frame.</li>
<li>SimpleAnimation: Consists of the animation play logic. The animation makes the tween object and target object, and it also interacts with the TweenAnimator.</li>
<li>SimpleAnimationGroup: Group of <code>simpleAnimation</code> objects. It can include several objects for animation.</li>
</pre>
<h3 id="stagger">Stagger</h3>
-<p>In case of handling an animation group, you can apply a different delay value to a group. The following example shows a delay with the <code>zoomIn</code> effect:</p>
+<p>When handling an animation group, you can apply a different delay value to a group. The following example shows a delay with the <code>zoomIn</code> effect:</p>
<pre class="prettyprint">
<div class='box'></div>
<div class='box'></div>
<h3>Exiting the Application with the Back Key</h3>
<p>When the application binds a <code>tizenhwkey</code> event, it checks the page ID and decides to go back or exit with several lines of app-side script.</p>
<p>The Tizen Device APIs provide an application exit method. Even if the application has many pages, it can handle the back/exit process.</p>
-<p>With a TAU page, just remember the ID of the main page. In the following example, the ID of the main page is <code>main</code>.</p>
+<p>With a TAU page, simply remember the ID of the main page. In the following example, the ID of the main page is <code>main</code>.</p>
<pre class="prettyprint">
(function() {
window.addEventListener('tizenhwkey', function(ev) {
<div class="note">
<strong>Note</strong>
- Do not copy all languages, just the ones you need.
+ Do not copy all languages; copy only the ones you need.
</div>
</td>
</tr>
<p>This feature is supported in mobile applications only.</p>
-<p>The Server-Sent Events API defines a simple data structure and interface, and a communication mechanism to realize the server push. In addition, it can handle the received data in the general DOM event format. However, the API repeatedly requests the data from the client to the server, so it is not a complete server push. The repeat period of the server request is determined by the <code>retry</code> value of the <a href="http://www.w3.org/TR/2015/REC-eventsource-20150203/#event-stream-interpretation" target="_blank">event stream data</a>. If the value is not defined, the repeat period is the default value of the browser.</p>
+<p>The Server-Sent Events API defines a simple data structure and interface, and a communication mechanism to realize the server push. In addition, it can handle the received data in the general DOM event format. However, the API repeatedly requests the data from the client to the server, so it is not a complete server push. The repeat period of the server request is determined by the <code>retry</code> field value of the <a href="http://www.w3.org/TR/2015/REC-eventsource-20150203/#event-stream-interpretation" target="_blank">event stream data</a>. If the value is not defined, the repeat period is the default value of the browser.</p>
<p>The main features of the Server-Sent Events API include:</p>
<ul>
<div id="container"><div id="contents"><div class="content">
<h1>WebSocket</h1>
-<p>WebSocket in a Web environment enables connection-oriented full duplex communication, as with a TCP socket. (The server and browser can send and receive data real-time through a continuously connected TCP line.)</p>
+<p>WebSocket in a Web environment enables connection-oriented full duplex communication, as with a TCP socket. (The server and browser can send and receive data in real-time through a continuously connected TCP line.)</p>
<p>This feature is supported in mobile and wearable applications only.</p>
<p>The main features of the Battery Status API include:</p>
<ul>
<li>Retrieving the battery status
- <p>You can use the attributes of the <code>BatteryManager</code> interface (in <a href="https://www.w3.org/TR/2016/CR-battery-status-20160707/#the-batterymanager-interface" target="_blank">mobile</a> and <a href="http://www.w3.org/TR/2012/CR-battery-status-20120508/#batterymanager-interface" target="_blank">wearable</a> applications) to <a href="#retrieve">check the battery status information</a>, such as battery charging status, remaining charging time (until fully charged), remaining battery life (until battery is empty), and battery level.</p></li>
+ <p>You can use the attributes of the <code>BatteryManager</code> interface (in <a href="https://www.w3.org/TR/2016/CR-battery-status-20160707/#the-batterymanager-interface" target="_blank">mobile</a> and <a href="http://www.w3.org/TR/2012/CR-battery-status-20120508/#batterymanager-interface" target="_blank">wearable</a> applications) to <a href="#retrieve">check the battery status information</a>, such as battery charging status, remaining charging time (until fully charged), remaining battery life (until battery is empty), and battery charge level.</p></li>
<li>Detecting battery status changes
<p>You can set event listeners with the <code>BatteryManager</code> interface attributes to <a href="#detect">detect changes in the battery status</a>.</p>
</ul>
<p>Knowing the battery status of the device helps you to defer or scale back work when the device is not charging or is low on battery. For example:</p>
-<ul><li>A Web-based email client can modify how often it checks the server for new email based on the battery status. It can make the check every few seconds if the device is charging or has a full battery, but less often if the device is not charging or is low on battery.</li>
+<ul><li>A Web-based email client can modify how often it checks the server for new email depending on the battery status. It can make the check every few seconds if the device is charging or has a full battery, but less often if the device is not charging or is low on battery.</li>
<li>A Web-based word processor can monitor the battery level and prevent data loss by saving any changes before the battery runs out.</li></ul>
</li>
<li>
-<p>Use the attributes of the <code>BatteryManager</code> interface (in <a href="https://www.w3.org/TR/2016/CR-battery-status-20160707/#the-batterymanager-interface" target="_blank">mobile</a> and <a href="http://www.w3.org/TR/2012/CR-battery-status-20120508/#batterymanager-interface" target="_blank">wearable</a> applications) to display the battery charging status, remaining charging time, remaining battery life, and battery level:</p>
+<p>Use the attributes of the <code>BatteryManager</code> interface (in <a href="https://www.w3.org/TR/2016/CR-battery-status-20160707/#the-batterymanager-interface" target="_blank">mobile</a> and <a href="http://www.w3.org/TR/2012/CR-battery-status-20120508/#batterymanager-interface" target="_blank">wearable</a> applications) to display the battery charging status, remaining charging time, remaining battery life, and battery charge level:</p>
<pre class="prettyprint">
</pre>
<p>If the battery is not charging, a message is displayed telling you to charge the battery.</p>
<p>
-You can use a progress bar to display the battery charging level.
+You can use a progress bar to display the battery charge level.
</p>
</li>
</ol>
<li>Detecting rotation
<p>You can use the <a href="http://www.w3.org/TR/2011/WD-orientation-event-20111201/#deviceorientation" target="_blank">deviceorientation</a> event to <a href="#rotate">detect rotation data</a> in order to rotate game characters or elements.</p></li>
<li>Detecting acceleration
-<p>You can <a href="#accelerate">use rotation speed (acceleration in the device) information</a>, including gravity, with the <a href="http://www.w3.org/TR/2011/WD-orientation-event-20111201/#devicemotion" target="_blank">devicemotion</a> event. You can move game characters or elements, and capture acceleration values to add certain events.</p></li>
+<p>You can <a href="#accelerate">use rotation speed (acceleration of the device) information</a>, including gravity, with the <a href="http://www.w3.org/TR/2011/WD-orientation-event-20111201/#devicemotion" target="_blank">devicemotion</a> event. You can move game characters or elements, and capture acceleration values to add certain events.</p></li>
</ul>
<h2 id="rotate" name="rotate">Detecting Device Rotation</h2>
var betaElem = document.getElementById('beta');
var gammaElem = document.getElementById('gamma');
</pre></li>
-<li>To track changes in the device rotation, subscribe to the <a href="http://www.w3.org/TR/2011/WD-orientation-event-20111201/#deviceorientation" target="_blank">deviceorientation</a> event:
+<li>To track changes in device rotation, subscribe to the <a href="http://www.w3.org/TR/2011/WD-orientation-event-20111201/#deviceorientation" target="_blank">deviceorientation</a> event:
<pre class="prettyprint lang-js">
window.addEventListener('deviceorientation', function(e) {
alphaElem.innerHTML ='alpha value ' + Math.round(e.alpha);
<p>To draw and manage shapes, you must <a href="#canvas">insert a <canvas> element</a> in the HTML page.</p>
</li>
<li>Using images
-<p>You can <a href="#image">use images in the canvas</a> by using the applicable method of the HTML Canvas 2D Context API.</p>
+<p>You can <a href="#image">use images on the canvas</a> by using the applicable method of the HTML Canvas 2D Context API.</p>
</li>
<li>Drawing shapes
<p>With the HTML Canvas 2D Context API, you can <a href="#shape">draw various shapes</a>, such as rectangles, circles, and lines to a canvas.</p>
<p>If no <code>width</code> and <code>height</code> attributes are inserted, the default value is <code>width: 300px, height: 150px</code>.</p>
</li>
-<li>To check the information on the image connected to the canvas, use the <code>toDataURL([Optional], [Variadic])</code> method to restore the URL of the image used in the canvas. To create a blob object of the image file, use the <code>getContext(contextId)</code> method.
+<li>To check the information on the image connected to the canvas, use the <code>toDataURL([Optional], [Variadic])</code> method to restore the URL of the image used on the canvas. To create a blob object of the image file, use the <code>getContext(contextId)</code> method.
</li>
<li>Use the <code>CanvasRenderingContext2D</code> interface (in <a href="http://www.w3.org/TR/2015/REC-2dcontext-20151119/#canvasrenderingcontext2d" target="_blank">mobile</a> and <a href="http://www.w3.org/TR/2012/CR-2dcontext-20121217/#canvasrenderingcontext2d" target="_blank">wearable</a> applications) to connect to the canvas and get the canvas context:
</ul>
<h2 id="image" name="image">Using Images on the Canvas</h2>
-<p>To use images in the canvas, use the <code>drawImage()</code> method of the HTML Canvas 2D Context API. The method receives information, such as the image URL and position, and where it is indicated, and then creates the image in the canvas. The created image is pixel-based.</p>
+<p>To use images on the canvas, use the <code>drawImage()</code> method of the HTML Canvas 2D Context API. The method receives information, such as the image URL and position, and where it is indicated, and then creates the image on the canvas. The created image is pixel-based.</p>
<div class="note">
<strong>Note</strong>
<p>To use images on a canvas:</p>
<ol><li>
- <p>Use the <code>drawImage()</code> method to express an image in the canvas.</p>
+ <p>Use the <code>drawImage()</code> method to express an image on the canvas.</p>
<p>When you define the URL of the image to be imported and its coordinates, the original image is imported as it is. You can hide certain parts of the image by assigning its size accordingly.</p>
<pre class="prettyprint">
/* Insert the converted image back to the canvas */
context.putImageData(transImage, 30, 20);
</pre></li>
-<li><p>Use the <code>CanvasTransformation</code> interface to transform the selected object, for example, its size, angle, or position. By connecting to the image used in the canvas, you can also rotate it. (The following figure applies to mobile applications only.)
+<li><p>Use the <code>CanvasTransformation</code> interface to transform the selected object, for example, its size, angle, or position. By connecting to the image used on the canvas, you can also rotate it. (The following figure applies to mobile applications only.)
</p>
<pre class="prettyprint">
<div class="note">
<strong>Note</strong>
- When drawing multiple images in a canvas, indicate the starting point with the <code>beginPath()</code> method to prevent unforeseen errors.
+ When drawing multiple images on a canvas, indicate the starting point with the <code>beginPath()</code> method to prevent unforeseen errors.
</div>
<h3>Source Code</h3>
</svg>
</pre></li>
-<li><p>To create a polygon comprised of a set of assigned coordinates, use the <code><polygon></code> element:</p>
+<li><p>To create a polygon consisting of a set of assigned coordinates, use the <code><polygon></code> element:</p>
<pre class="prettyprint">
<svg xmlns="http://www.w3.org/2000/svg" width="300px" height="200px">
\r
<div class="note">\r
<strong>Note</strong>\r
- Tizen supports a WebKit-based <code>GetUserMedia()</code> method, so always use it in the <code>webkitGetUserMedia()</code> format.\r
+ Tizen supports a WebKit-based <code>GetUserMedia()</code> method, so always add the <code>webkit</code> prefix to the method name.\r
</div>\r
\r
<h2 id="access" name="access">Accessing a Video Stream</h2>\r
</pre>\r
</li>\r
\r
-<li><p>Display the captured frame in a <a href="video_audio_w.htm">video</a> element using the <code>drawImage()</code> method: </p>\r
+<li><p>Display the captured frame in a <a href="video_audio_w.htm">video</a> element using the <code>drawImage()</code> method: </p>\r
<pre class="prettyprint">\r
<script>\r
var localStream = '';\r
};\r
</pre>\r
</li>\r
- <li><p>Use the <code>addEventListener()</code> method to listen to the event of receiving a message:</p>\r
+ <li><p>Use the <code>addEventListener()</code> method to listen for the event of receiving a message:</p>\r
<pre class="prettyprint">\r
worker.addEventListener('message', function(e) {\r
alert(e.data);\r
<div id="container"><div id="contents"><div class="content">
<h1>Indexed Database</h1>
- <p>In HTML5, an indexed database is a local storage used to store and manipulate data in a client. You can implement effective searches using an index as a simple storage structure in the key-value format.
+ <p>In HTML5, an indexed database is a local storage used to store and manipulate data in a client. You can implement effective searches using an index as a simple storage structure in key-value format.
</p>
<p>This feature is supported in mobile and wearable applications only.</p>
<div id="container"><div id="contents"><div class="content">
<h1>Web Storage</h1>
-<p>A Web storage stores data in the key-value format. The process is similar to existing cookies, but by using the Web Storage API, structured objects can be stored, and the storage capacity increased to 5 MB per domain. In addition, no server request is needed, so the server traffic is significantly reduced.</p>
+<p>A Web storage stores data in key-value format. The process is similar to existing cookies, but by using the Web Storage API, structured objects can be stored, and the storage capacity is increased to 5 MB per domain. In addition, no server request is needed, so server traffic is significantly reduced.</p>
<p>This feature is supported in mobile and wearable applications only.</p>
<p>Saving, reading, and deleting data in a local Web storage is a useful data management skill:</p>
<ol>
<li>
-<p>To save data in the storage, use the <code>setItem()</code> method that saves data in the key-value format:</p>
+<p>To save data in the storage, use the <code>setItem()</code> method that saves data in key-value format:</p>
<pre class="prettyprint">
<script>
localStorage.setItem(key.value, data.value);
<script>
var vertexPositionAttribute = gl.getAttribLocation(program, 'attVertexPos');
</pre>
-<p>The shader is an external program that is compiled. To enable the attribute to be searched and referenced in the program, allocate it to the <code>vertexPositionAttribute</code> variable.</p>
+<p>The shader is an external program that is compiled. To enable the attribute to be searched for and referenced in the program, allocate it to the <code>vertexPositionAttribute</code> variable.</p>
</li>
<li><p>Activate the attribute data array:</p>
</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, for RGBA, 4.</p>
<pre class="prettyprint">
gl.vertexAttribPointer(vertexPositionAttribute, 2, gl.FLOAT, false, 0, 0);
<tr>
<td rowspan="1" colspan="1"> <p><code>TRIANGLES</code></p> </td>
- <td rowspan="1" colspan="1"><p>In the triangles type, 2 triangles are comprised of 3 vertices. In the example, 6 vertices are needed.
+ <td rowspan="1" colspan="1"><p>In the triangles type, 2 triangles consist of 3 vertices each. In the example, 6 vertices are needed.
</p>
<p align="center"><img alt="Triangles" src="../../../images/drawing_triangles.png" /></p>
</pre>
</li>
-<li><p>Define a rectangular vertex comprised of 2 triangles:</p>
+<li><p>Define a rectangular vertex consisting of 2 triangles:</p>
<pre class="prettyprint lang-js">
<script>
var vertices = [1.0, 1.0, /* p1 */
gl.bindTexture(gl.TEXTURE_2D, texture);
gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, true);
</pre>
-<p>The image data loaded in HTML has the opposite y-axis as the WebGL™ direction. Use the <code>gl.UNPACK_FLIP_Y_WEBGL</code> attribute to reverse the data and store it.</p>
+<p>The image data loaded in HTML has the opposite Y axis as the WebGL™ direction. Use the <code>gl.UNPACK_FLIP_Y_WEBGL</code> attribute to reverse the data and store it.</p>
</li>
<li><p>Use the loaded image file to fill the texture data. The <code>texImage2D()</code> method assigns the image to be used as a texture, and the <code>textParameteri()</code> method assigns a filter.</p>
<p>You can <a href="#prop_ani">define various properties</a> to control animations.</p></li>
</ul>
-<p>When using the CSS animation properties, the Tizen browser requires the <code>-webkit-</code> prefix.</p>
+
<h2 name="keyframe" id="keyframe">Using Keyframes</h2>
<p>The CSS animations work based on <code>@-webkit-keyframes</code> rules defined for specific elements. The rules can define various property changes complementing the simple running of a transition.</p>
<h2 id="create" name="create">Creating a Color Generator</h2>
-<p>To enhance the user experience of your application, you must learn to create a HSLA color generator to set the color value for an element in the HSLA format.</p>
+<p>To enhance the coloring of the UI elements in your application, you must learn to generate color values in the HSLA format:</p>
<p align="center"><strong>Figure: HSLA color generator</strong></p>
<p align="center"><img alt="HSLA color generator" src="../../../images/css_color_tutorial1.png" /></p>
</ul>
<h2 id="js" name="js">JavaScript Behavior</h2>
-<p>With the advent of HTML5, numerous powerful HTML5 APIs have been introduced. Since the usage of JavaScript has increased, it has become important to use it accurately in accordance with <a href="../perf_opt/js_performance_improvement_w.htm">optimized JavaScript performance</a>.</p>
+<p>With the advent of HTML5, numerous powerful HTML5 APIs have been introduced. Since the usage of JavaScript has increased, it has become important to use it correctly and <a href="../perf_opt/js_performance_improvement_w.htm">optimize JavaScript performance</a>.</p>
<p><a href="#use">JavaScript used in Web applications</a> can be divided into the core, <a href="http://www.ecma-international.org/publications/standards/Ecma-262.htm" target="_blank">ECMAScript</a>, and <a href="http://www.w3.org/DOM" target="_blank">DOM</a>, which all manipulate HTML. ECMAScript is executed when a method is called, or it can be executed when an event is fired within a HTML document through a linkage with DOM. </p>
<p>When multiple media queries and conditions are defined, CSS is applied with the following priorities:</p>
<ul>
-<li>In case of the CSS reiteration declaration, the CSS that has been declared last is applied.</li>
-<li>In case of specificity, the CSS with the highest specificity is applied.
+<li>For CSS reiteration declaration, the CSS that has been declared last is applied.</li>
+<li>For specificity, the CSS with the highest specificity is applied.
<p>The specificity is calculated as follows:</p><ul><li>id attribute = 100</li>
<li>class attribute = 10</li>
<li>element = 1</li></ul>
<p>Selectors, such as <code>section#content > .title p</code>, carry the specificity of 112.</p></li>
-<li>In case of user override, the user CSS is applied instead of the creator CSS.</li>
+<li>In the case of user override, the user CSS is applied instead of the creator CSS.</li>
<li><p>CSS is applied first based on the conditions in the <code>@import</code> rule, then based on the conditions in CSS, and finally based on the conditions in HTML.</p></li>
<li><p>In media queries, regardless of CSS priority, CSS which has not been imported still exists based on the conditions.</p></li>
</ul>
<li><a href="#break">Setting the column break</a></li>
</ul>
-<div class="note">
- <strong>Note</strong>
- Up to Tizen 2.2, most CSS properties and values used in Tizen required the <code>-webkit-</code> prefix. To ensure future compatibility, these properties can now be used with or without the prefix.
-</div>
<h2 id="size" name="size">Setting the Column Number and Width</h2>
</pre>
<p>The <code>column-width</code> property defines the default column width but the visible width is not always similar. An algorithm calculates the width according to available space. Normally, a column has a different display width from the one set in the property because as the columns are sized to fill all available space.</p>
-<p>For example, on a 480 x 800 display with portrait orientation, the device width is 123 px, whereas on a 720 x 1280 display with a landscape orientation, the width is 120 px. The space available for columns is the <code>width</code> attribute value reduced by <code>padding</code>, in this case 80vw - (2 * 5vw) = 70vw, which means 70/100 width of the device display.</p>
+<p>For example, on a 480 x 800 display in portrait orientation, the device width is 123 px, whereas on a 720 x 1280 display in landscape orientation, the width is 120 px. The space available for columns is the <code>width</code> attribute value reduced by <code>padding</code>, in this case 80vw - (2 * 5vw) = 70vw, which means 70/100 width of the device display.</p>
</li>
<li>
<p>Use the <code>column-gap</code> (or <code>-webkit-column-gap</code>) property to set the distance between columns:</p>
</li>
<li>
<p>Set image elements to have an automatic <code>margin</code> to center them within the column.</p>
-<p>In case of the image whose <code>id</code> attribute is set to <code>figure</code>, set it to be a floating element with text drawn around it.</p>
+<p>If the image <code>id</code> attribute is set to <code>figure</code>, set it to be a floating element with text drawn around it.</p>
<pre class="prettyprint">
img {
<p><a href="media_query_w.htm">Media Queries</a> and <a href="flexible_w.htm">Flexible Box Layout</a> can be used to create flexible layouts, and to build the deployable package easily.</p>
<p>Images can be used in Web applications in the following ways:</p>
- <ul><li><code>IMG</code> tag linking images directly to HTML</li>
+ <ul><li><code>IMG</code> element linking images directly to HTML</li>
<li>CSS <code>background</code> property expressing images as a background in HTML</li>
<li><a href="../graphics/svg_w.htm">SVG (Scalable Vector Graphics)</a>, <a href="../graphics/canvas_w.htm">Canvas</a>, and <a href="http://www.khronos.org/registry/webgl/specs/latest/" target="blank">WebGL™</a> APIs implementing graphics in HTML</li>
</ul>
</ul>
<h3 id="photos" name="photos">Photos</h3>
- <p>An image can be added to an application using the HTML <code>img</code> tag, or CSS <code>background</code> property as shown in the following example:</p>
+ <p>An image can be added to an application using the HTML <code>img</code> element, or CSS <code>background</code> property as shown in the following example:</p>
<pre class="prettyprint">
<!--HTML-->
<img src="images/sample.jpg" alt="sample image"/>
<p align="center"><strong>Figure: Network capacity usage of a GIF image</strong></p>
<p align="center"><img alt="Network" src="../../../images/network.png"/></p>
- <p>GIF animation can be created in various resolutions without quality loss, when you use the option introduced in <a href="#photos">Photos</a>. This, however, increases memory occupancy.</p>
+ <p>GIF animation can be created in various resolutions without quality loss when you use the option introduced in <a href="#photos">Photos</a>. This, however, increases memory occupancy.</p>
<h4 id="js" name="js">JavaScript Animation</h4>
</ul>
-<p>When using the CSS transform properties, the Tizen browser requires no prefix, the Firefox browser requires the <code>-moz-</code> prefix, the Google Chrome™ and Safari browsers require the <code>-webkit-</code> prefix, and the Opera browser requires the <code>-o-</code> prefix.</p>
-
<h2 name="prop_trans" id="prop_trans">Defining Transform Properties</h2>
<p>You can define various properties to control the elements within the coordinate space:</p>
<p>In 3D transforms, the Z axis has been added (for example, <code>translateZ(number)</code> and <code>scale3dZ(number)</code>). When handling 3D transforms, pay attention to the following:</p>
<ul>
-<li>If a transform method is used together with the <code>perspective</code> property, the z axis is emphasized.</li>
+<li>If a transform method is used together with the <code>perspective</code> property, the Z axis is emphasized.</li>
<li>The X, Y, and Z values of the <code>translate3d()</code>, <code>scale3d()</code>, and <code>rotate3d()</code> methods can be expressed in individual methods.</li>
<li>In the <code>rotate3d(number, number, number, angle)</code> method, the element rotates according to the assigned parameter (angle) with the X, Y, and Z directional vectors as the center. Each vector can be expressed as an individual method: for example, the <code>rotateX(<angle>)</code> and <code>rotate3d(1, 0, 0, <angle>)</code> methods perform the same task.</li>
</ul>
<ol>
<li>A structure layer is created and added to the document. This is a CPU task.</li>
<li>The added layer is painted as a default value. This is a GPU task.</li>
- <li>The layer is painted once again according to the change of value. This is a CPU operation.</li>
+ <li>The layer is painted once again according to the change of value. This is a CPU task.</li>
</ol>
-<p>Steps a and c incur CPU tasks, which affect performance the most.</p>
-<p>In case of step a, only 2 layers are created, but as the number of layers created increases, the efficiency of page rendering work drops. In case of step c as well, the more steps it undergoes, the slower the rendering becomes.</p>
-<p>In certain browsers, even if the style of just 1 layer is changed, the entire document is repainted. As the repainting takes only a moment, any animation effects that are supposed to happen cannot be executed in such a short time. This issue occurs frequently in Android™ with severe fragmentation.</p>
+<p>Steps 1 and 3 incur CPU tasks, which affect performance the most.</p>
+<p>In step 1, only 2 layers are created, but as the number of layers created increases, the efficiency of page rendering drops. In step 3 as well, the more steps it undergoes, the slower the rendering becomes.</p>
+<p>In certain browsers, even if the style of only 1 layer is changed, the entire document is repainted. As the repainting takes only a moment, any animation effects that are supposed to happen cannot be executed in such a short time. This issue occurs frequently in Android™ with severe fragmentation.</p>
<div class="note">
<strong>Note</strong>
<div class="note">
<strong>Note</strong>
- In case of using 3D effects, <code>-webkit-transform: translateZ(0);</code> can be used to accelerate the hardware. However, since hardware acceleration support varies between the OS and devices, the actual resulting effects can vary too. Moreover, in the case of version Android 2.1, iOS 3.X and below, note that transition and animation may not be realized.
+ When using 3D effects, <code>-webkit-transform: translateZ(0);</code> can be used to accelerate the hardware. However, since hardware acceleration support varies among operating systems and devices, the resulting effects can vary too. Moreover, on Android 2.1 or iOS 3.X and below, transitions and animations may not be realized.
</div>
</li>
<li>Create a modal layer pop-up using CSS3:
<p>You can improve the rendering performance of the application by <a href="#hw">enabling hardware acceleration</a>.</p></li>
</ul>
-<p>When using the CSS transition properties, the Tizen browser requires the <code>-webkit-</code> prefix.</p>
+
<h2 name="prop" id="prop">Defining Transition Properties</h2>
<p align="center"><strong>Figure: Typical wearable Web application layout</strong></p>
<p align="center"><img alt="Typical wearable Web application layout" src="../../../images/layout_app.png"/></p>
-<p>Not setting the place of the header and footer areas clearly can easily cause problems for your layout. In case of the header, the side-effect is relatively small. However, a wrongly defined footer area can be quite visible and lead to poor usability. The following figure shows the original layout of a pedometer application that consists of a header, content, and footer, with a Stop button set in the footer area. </p>
+<p>Not setting the place of the header and footer areas clearly can easily cause problems for your layout. For the header, the side-effect is relatively small. However, a wrongly defined footer area can be quite visible and lead to poor usability. The following figure shows the original layout of a pedometer application that consists of a header, content, and footer, with a Stop button set in the footer area. </p>
<p align="center"><strong>Figure: 320x320 sample Web application</strong></p>
<p align="center"><img alt="320x320 sample Web application" src="../../../images/layout_sample.png"/></p>
<h3 id="flexible" name="flexible">Flexible Media</h3>
<p>One of key elements used in the content area is a media element, including image and video. As all other elements, the media elements also must be placed within a relative layout to allow the application flexibly handle resolution changes. When such relative sizing is applied to a media element, it is called <strong>flexible media</strong> in responsive Web design. </p>
-<p>The main issue when making a media element size relative is to ensure that the usable ratio does not change. The following figure shows a video element that works on both 320x320 and 360x480 resolutions, even though the aspect ratio of the screen is changed and scaled up. Basically, when handling media elements, you want to keep the size or ratio of the element the same as in the initially targeted device, even when displayed using a different resolution and aspect ratio. To achieve this, set the width and height properties of the media element with percentage and the auto keyword.</p>
+<p>The main issue when making a media element size relative is to ensure that the usable ratio does not change. The following figure shows a video element that works on both 320x320 and 360x480 resolutions, even though the aspect ratio of the screen is changed and scaled up. Basically, when handling media elements, you want to keep the size or ratio of the element the same as on the initially targeted device, even when displayed using a different resolution and aspect ratio. To achieve this, set the width and height properties of the media element with percentage and the auto keyword.</p>
<p align="center"><strong>Figure: Flexible media on 320x320 and 360x480</strong></p>
<p><code>.video iframe {width: 100%; height: auto;}</code></p>
</li>
<li>Set extra spaces both at the top and bottom.
- <p>During the migration, you can see how a certain portion of the rectangle view is covered over by the circular view, especially the header and the footer. To make them fully and consistently visible in the circular view, provide a "padding" space at the top and bottom of the page. In the following example migrating to a circular gear device from a rectangular Gear S, extra 77 px padding is used:</p>
+ <p>During the migration, you can see how a certain portion of the rectangle view is covered over by the circular view, especially the header and the footer. To make them fully and consistently visible in the circular view, provide a "padding" space at the top and bottom of the page. In the following example of migrating to a circular gear device from a rectangular Gear S, extra 77 px padding is used:</p>
<pre class="prettyprint">
@media all and (-tizen-geometric-shape: circle) {
section {padding: 77px 0;}
<div class="note">
<strong>Tip</strong>
To minimize the property access time:
-<ul><li>Property depth: the deeper the property hierarchy is, the more search time is requires (object.name < object.name.name).</li>
+<ul><li>Property depth: the deeper the property hierarchy is, the more search time is required (object.name < object.name.name).</li>
<li>Property notation: dot notation is faster than associate notation in Webkit (object.name < object ["name"]).</li></ul>
</div>
<h2 id="event" name="event">Improving the Event Handler Response Time</h2>
-<p>When the number of event handlers grows in the DOM tree, Webkit consumes more memory to trace the events and the response time for each event increases. To prevent the response time slow-down, you can use a technique called event delegation.</p>
-<p>Event delegation means that you attach just one handler in the parent element and let it handle all the events from the child elements. Event delegation is based on events propagating up to the parent node, called bubbling, so the parent can handle all the events from the child nodes.</p>
+<p>As the number of event handlers grows in the DOM tree, Webkit consumes more memory to trace the events and the response time for each event increases. To prevent response time slow-down, you can use a technique called event delegation.</p>
+<p>Event delegation means that you attach only one handler in the parent element and let it handle all the events from the child elements. Event delegation is based on bubbling, or events propagating up to the parent node, so the parent can handle all the events from the child nodes.</p>
<p>The following example illustrates the issue.</p>
<h2 id="launch" name="launch">Improving the Application Launch Time</h2>
-<p>The basic principle of improving the launch time of a Web application is simply to "show first page as fast as possible and do nothing but UI rendering". To apply this principle:</p>
+<p>The basic principle of improving the launch time of a Web application is simply to "show first page as quickly as possible and do nothing but UI rendering". To apply this principle:</p>
<ul>
<li>Reduce the number of files.
<p>The intuition behind the rule to reducing the number of files can be expressed as "less files > less file operations > faster load". As shown in the following table, you can reduce 3 JavaScript files to just 1 while keeping the same content.</p>
-<p>In case of large-scale Web applications, 1 application can contain 20-30 or even more JavaScript files, and concatenating the JavaScript can make the initial file operations significantly faster, eventually leading to a faster launch time.</p>
+<p>In large-scale Web applications, 1 application can contain 20-30 or even more JavaScript files, and concatenating the JavaScript can make the initial file operations significantly faster, leading to a faster launch time.</p>
<p align="center" class="Table"><strong>Table: Example of reducing the number of files</strong></p>
<table border="1">
<p>This feature is supported in mobile applications only.</p>
- <p>Sound is not played in case of a tap event for:</p>
+ <p>Sound is not played on a tap event for:</p>
<ul>
<li>HTML elements whose disabled property is set to <code>disabled</code></li>
<li>HTML <code><input></code> elements whose type attribute is set to one of the following editable types:
<li>HTML <code><textarea></code> elements</li>
</ul>
- <p>Sound is played in case of a tap event for:</p>
+ <p>Sound is played on a tap event for:</p>
<ul>
<li>HTML <code><a></code> elements with the <code>href</code> attribute</li>
<li>HTML <code><area></code> elements with the <code>href</code> attribute</li>