<li><p>A system event (such as an incoming phone call) occurs and causes a resident application with a higher priority to become active and temporarily hide your application.</p></li>
<li><p>An alarm is triggered for another application, which becomes the top-most window and hides your application.</p> </li>
</ul>
+<p>Since Tizen 2.4, the application on the background will go into the suspended state. In the suspended state, the application process will executed with limited CPU resources. In other words, the platform will not allow running the background application except some applications such as Media, Download and etc. that should necessary to work on the background. In this case, the application can designate their background category as allowed categories to avoid changing the suspended state. See <a href="../../../../org.tizen.guides/html/native/app/application_n.htm#allow_bg">Allowing Applications to Run on the Background</a> for more information.</p>
<p>When your application becomes visible again, the <span style="font-family: Courier New,Courier,monospace;">app_resume_cb()</span> callback is invoked. The visibility returns, when:</p>
<ul>
<li><p>Your application itself requests to exit by calling the <span style="font-family: Courier New,Courier,monospace;">ui_app_exit()</span> or <span style="font-family: Courier New,Courier,monospace;">service_app_exit()</span> function to terminate the event loop.</p></li>
<li><p>The low memory killer is terminating your application in a low memory situation.</p></li>
</ul>
-<p>Since the service application has no UI, it also has no pause state.</p>
+<p>Because the service application has no UI, it also has no pause state. Since Tizen 2.4, the service application could go into the suspended state. Basically, the service application is running on the background by its nature; so the platform will not allow running the service application unless designated as a background category application. However, when the UI application that is packaged with the service application is running in foreground, the service application is also regarded as a foreground application and it can be run without designating background category.</p>
<p>Application state changes are managed by the underlying framework.
For more information about application state transitions, see <a href="../../../../org.tizen.guides/html/native/app/application_n.htm#state_trans">Managing Application States and Transitions</a>.</p>
<li><a href="#app_controls">Launching Applications</a></li>
<li><a href="#alarms">Handling Alarms</a></li>
<li><a href="#state_trans">Managing Application States and Transitions</a></li>
+ <li><a href="#allow_bg">Allowing Application to Run on the Background</a></li>
<li><a href="#app_strings">Localizing Application Strings</a></li>
</ul>
<p class="toc-title">Related Info</p>
<p class="figure">Figure: Application state transitions</p>
<p align="center"><img alt="Application state transitions" src="../../images/app_state_transitions.png" /></p>
-
+
+<h2 id="allow_bg" name="allow_bg">Allowing Applications to Run on the Background</h2>
+<p>Since Tizen 2.4, the application is not allowed to run on the background except declared to run on the background explicitly. The following table lists the supported background categories.
+</p>
+<div class="table"><table>
+ <caption>
+ Table: Allowed Background Application Policy
+ </caption>
+ <tbody>
+ <tr>
+ <th>Background Category</th>
+ <th>Description</th>
+<th>Related APIs</th>
+<th>Manifest background-category value</th>
+ </tr>
+ <tr>
+ <td><span style="font-family: Courier New,Courier,monospace">Media</span></td>
+ <td>Playing audio, recording, and outputting streaming video in background</td>
+<td>Multimedia API</td>
+<td>media</td>
+ </tr>
+ <tr>
+ <td><span style="font-family: Courier New,Courier,monospace">Download</span></td>
+ <td>Downloading data with the Tizen download-manager API</td>
+<td>Download-manager API</td>
+<td>download</td>
+ </tr>
+ <tr>
+ <td><span style="font-family: Courier New,Courier,monospace">Background network</span></td>
+ <td>Processing general network operation in background (Sync-manager, IM / VOIP)</td>
+<td>Sync-manager, Socket, Curl</td>
+<td>background-network</td>
+ </tr>
+<tr>
+ <td><span style="font-family: Courier New,Courier,monospace">Location</span></td>
+ <td>Processing location data in background</td>
+<td>Location API</td>
+<td>location</td>
+ </tr>
+<tr>
+ <td><span style="font-family: Courier New,Courier,monospace">Sensor (context)</span></td>
+ <td>Processing context data from the sensors such as gesture</td>
+<td>Sensor API</td>
+<td>sensor</td>
+ </tr>
+<tr>
+ <td><span style="font-family: Courier New,Courier,monospace">IoT Communication/Connectivity</span></td>
+ <td>Communicating between external devices in background such as Wi-Fi, Bluetooth</td>
+<td>Wi-Fi, Bluetooth API</td>
+<td>iot-communication</td>
+ </tr>
+
+
+
+ </tbody>
+ </table></div>
+
+ <p></p><h3 id="bg-category" name="bg-category">Describing Background Category</h3>
+<p>An application with background running capability should declare the background category in its manifest file:</p>
+
+<pre class="prettyprint"><span class="tag"><?xml version="1.0" encoding="utf-8"?></span>
+<span class="pln"> </span><span class="tag"><manifest</span><span class="pln"> </span><span class="atn">xmlns</span><span class="pun">=</span><span class="atv">"http://tizen.org/ns/packages"</span><span class="pin"> </span><span class="atn">api-version</span><span class="pun">=</span><span class="atv">"2.4"</span><span class="pin"> </span><span class="atn">package</span><span class="pun">=</span><span class="atv">"org.tizen.test"</span><span class="pin"> </span><span class="atn">version</span><span class="pun">=</span><span class="atv">"1.0.0"</span><span class="tag">></span><span class="pln"></span>
+<span class="pln"> </span><span class="tag"><ui-application</span><span class="pln"> </span><span class="atn">appid</span><span class="pun">=</span><span class="atv">"org.tizen.test"</span><span class="pin"> </span><span class="atn">exec</span><span class="pun">=</span><span class="atv">"text"</span><span class="pin"> </span><span class="atn">type</span><span class="pun">=</span><span class="atv">"capp"</span><span class="pin"> </span><span class="atn">multiple</span><span class="pun">=</span><span class="atv">"false"</span><span class="pin"> </span><span class="atn">taskmanage</span><span class="pun">=</span><span class="atv">"true"</span><span class="pin"> </span><span class="atn">nodisplay</span><span class="pun">=</span><span class="atv">"false"</span><span class="tag">></span><span class="pln"></span>
+<span class="pln"> </span><span class="tag"><icon></span>rest.png<span class="tag"></icon></span>
+<span class="pln"> </span><span class="tag"><label></span>rest<span class="tag"></label></span>
+<span class="pln"> </span><span class="tag"><background-category</span><span class="pin"> </span><span class="atn">value</span><span class="pun">=</span><span class="atv">"media"</span><span class="tag">/></span>
+<span class="pln"> </span><span class="tag"><background-category</span><span class="pin"> </span><span class="atn">value</span><span class="pun">=</span><span class="atv">"download"</span><span class="tag">/></span>
+<span class="pln"> </span><span class="tag"><background-category</span><span class="pin"> </span><span class="atn">value</span><span class="pun">=</span><span class="atv">"background-network"</span><span class="tag">/></span>
+<span class="pin"> </span><span class="tag"></ui-application></span>
+<span class="pin"> </span><span class="tag"><service-application</span><span class="pin"> </span><span class="atn">appid</span><span class="pun">=</span><span class="atv">"org.tizen.test-service"</span><span class="pin"> </span><span class="atn">exec</span><span class="pun">=</span><span class="atv">"test-service"</span><span class="pin"> </span><span class="atn">multiple</span><span class="pun">=</span><span class="atv">"false"</span><span class="pin"> </span><span class="atn">type</span><span class="pun">=</span><span class="atv">"capp"</span><span class="tag">/></span>
+<span class="pln"> </span><span class="tag"><background-category</span><span class="pin"> </span><span class="atn">value</span><span class="pun">=</span><span class="atv">"background-network"</span><span class="tag">/></span>
+<span class="pln"> </span><span class="tag"><background-category</span><span class="pin"> </span><span class="atn">value</span><span class="pun">=</span><span class="atv">"location"</span><span class="tag">/></span>
+<span class="pin"> </span><span class="tag"></service-application></span>
+<span class="pin"></span><span class="tag"></manifest></span>
+</pre>
+<table class="note">
+ <tbody>
+ <tr>
+ <th class="note">Note</th>
+ </tr>
+ <tr>
+ <td class="note"><p><span class="tag"><background-category></span> element is supported for the API version equal or higher than 2.4</p></td>
+ </tr>
+ </tbody>
+</table>
+<p>The background category of your application can be specified in the
+<a href="file:///home/kilio/spin/sdk/doc/online-doc/org.tizen.gettingstarted/html/native/process/setting_properties_n.htm#manifest">application project settings</a> in the IDE.</p>
+
+
+
<h2 id="app_strings" name="app_strings">Localizing Application Strings</h2>
<p>Tizen provides localized resources to make your application usable for different countries. The localization is based on the Internationalization API (in <a href="../../../../org.tizen.native.mobile.apireference/group__CAPI__I18N__MODULE.html">mobile</a> and <a href="../../../../org.tizen.native.wearable.apireference/group__CAPI__I18N__MODULE.html">wearable</a> applications), which makes strings translatable and places them in .po (portable object) files.</p>
</script>
</body>
-</html>
\ No newline at end of file
+</html>