add Background category description
authorDaehyeon Jung <darrenh.jung@samsung.com>
Tue, 30 Jun 2015 11:20:08 +0000 (20:20 +0900)
committerDaehyeon Jung <darrenh.jung@samsung.com>
Tue, 30 Jun 2015 12:22:17 +0000 (21:22 +0900)
Change-Id: I1510297f1bdb10209c0ec4c861fb63c7a77b65d2
Signed-off-by: Daehyeon Jung <darrenh.jung@samsung.com>
org.tizen.gettingstarted/html/native/app_model/application_model_n.htm
org.tizen.gettingstarted/html/native/process/setting_properties_n.htm
org.tizen.guides/html/native/app/application_n.htm

index b66cacd..4995e18 100644 (file)
@@ -66,6 +66,7 @@ These devices have constraints, such as relatively small screen sizes and lack o
     <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>
@@ -79,7 +80,7 @@ These devices have constraints, such as relatively small screen sizes and lack o
     <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>
index daca313..b1e5dd8 100644 (file)
 </table>
 </li>
    <li>Export DataControl functionality. <p>You can <a href="../../../../org.tizen.guides/html/native/app/data_control_n.htm#export">export data functionalities</a> of your Tizen native application.</p> <p>To define a data control used to export application data, click <strong>Add</strong> and define the data control details.</p> </li> 
+   <li>Add background category type(since Tizen 2.4).<p>You can <a href="../../../../org.tizen.guides/html/native/app/application_n.htm#bg-category">describe background category</a> of your Tizen native application.</p> <p>To add background category types to allow run on the background, click <strong>Add</strong> and select the category type.</p> </li>
 
   </ul>
 
index 070bcb9..ab95063 100644 (file)
@@ -27,6 +27,7 @@
                        <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>
@@ -618,7 +619,96 @@ static void app_control(app_control_h app_control, void *user_data)
   
   <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">&lt;?xml version="1.0" encoding="utf-8"?&gt;</span>
+<span class="pln">&nbsp;&nbsp;&nbsp;</span><span class="tag">&lt;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">&gt;</span><span class="pln"></span>
+<span class="pln">&nbsp;&nbsp;&nbsp;</span><span class="tag">&lt;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">&gt;</span><span class="pln"></span>
+<span class="pln">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="tag">&lt;icon&gt;</span>rest.png<span class="tag">&lt;/icon&gt;</span>
+<span class="pln">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="tag">&lt;label&gt;</span>rest<span class="tag">&lt;/label&gt;</span>
+<span class="pln">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="tag">&lt;background-category</span><span class="pin"> </span><span class="atn">value</span><span class="pun">=</span><span class="atv">"media"</span><span class="tag">/&gt;</span>
+<span class="pln">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="tag">&lt;background-category</span><span class="pin"> </span><span class="atn">value</span><span class="pun">=</span><span class="atv">"download"</span><span class="tag">/&gt;</span>
+<span class="pln">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="tag">&lt;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">/&gt;</span>
+<span class="pin">&nbsp;&nbsp;&nbsp;</span><span class="tag">&lt;/ui-application&gt;</span>
+<span class="pin">&nbsp;&nbsp;&nbsp;</span><span class="tag">&lt;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">/&gt;</span>
+<span class="pln">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="tag">&lt;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">/&gt;</span>
+<span class="pln">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="tag">&lt;background-category</span><span class="pin"> </span><span class="atn">value</span><span class="pun">=</span><span class="atv">"location"</span><span class="tag">/&gt;</span>
+<span class="pin">&nbsp;&nbsp;&nbsp;</span><span class="tag">&lt;/service-application&gt;</span>
+<span class="pin"></span><span class="tag">&lt;/manifest&gt;</span>
+</pre>
+<table class="note">
+  <tbody>
+    <tr>
+      <th class="note">Note</th>
+    </tr>
+    <tr>
+      <td class="note"><p><span class="tag">&lt;background-category&gt;</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> 
 
@@ -872,4 +962,4 @@ var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga
 </script>
 
 </body>
-</html>        
\ No newline at end of file
+</html>