add background-category tag for web application
authorCho Woongsuk <ws77.cho@samsung.com>
Thu, 24 Sep 2015 07:50:44 +0000 (16:50 +0900)
committerCho Woongsuk <ws77.cho@samsung.com>
Thu, 24 Sep 2015 07:51:05 +0000 (16:51 +0900)
Change-Id: I2c31637cf9b2d1ce20028382c69ff5333443786c
Signed-off-by: Cho Woongsuk <ws77.cho@samsung.com>
org.tizen.devtools/html/web_tools/config_editor_w.htm [changed mode: 0644->0755]
org.tizen.guides/html/web/tizen/application/application_w.htm [changed mode: 0644->0755]

old mode 100644 (file)
new mode 100755 (executable)
index cb321e1..d8a05b1
     </tr>\r
     <tr>\r
         <td style="border:none;">&nbsp;</td>\r
+        <td colspan="3" style="border:none;"><span style="font-family: Courier New,Courier,monospace">&lt;tizen:background-category&gt;</span> (in <a href="#mw_bg_category">mobile</a> or <a href="#ww_bg_category">wearable</a>)</td>\r
+    </tr>\r
+    <tr>\r
+        <td style="border:none;">&nbsp;</td>\r
         <td colspan="3" style="border:none;"><span style="font-family: Courier New,Courier,monospace">&lt;tizen:content-security-policy&gt;</span> (in <a href="#mw_sec">mobile</a> or <a href="#ww_contentsecpolicy">wearable</a>)</td>\r
     </tr>\r
     <tr>\r
     </ul>\r
      <p><strong>Attributes:</strong> </p>\r
       <ul>\r
-       <li><span style="font-family: Courier New,Courier,monospace;">background-support</span> <p>Optional; application execution continues when it is moved to the background (available values <span style="font-family: Courier New,Courier,monospace;">enable</span>, <span style="font-family: Courier New,Courier,monospace;">disable</span> (default))</p></li>\r
+       <li><span style="font-family: Courier New,Courier,monospace;">background-support</span> <p>Optional; application execution continues when it is moved to the background (available values <span style="font-family: Courier New,Courier,monospace;">enable</span>, <span style="font-family: Courier New,Courier,monospace;">disable</span> (default))</p>\r
+                <table class="note">\r
+                <tbody>\r
+                 <tr>\r
+                  <th class="note">Note</th>\r
+                 </tr>\r
+                 <tr>\r
+                  <td class="note">Since Tizen 2.4, background processes are managed more tightly by the system. Even if <span style="font-family: Courier New,Courier,monospace;">background-support</span> is set to <span style="font-family: Courier New,Courier,monospace;">enable</span>, the web application process which is moved to background may be suspended. To guarantee that a web application will run in the background, at least one background category should be added with the <span style="font-family: Courier New,Courier,monospace;">&lt;tizen:background-category&gt; </span>tag. Only background categories which have been declared in the system may be used.</td>\r
+                 </tr>\r
+                </tbody>\r
+               </table>\r
+       </li>\r
        <li><span style="font-family: Courier New,Courier,monospace;">context-menu</span> <p>Optional; context menu is displayed when the user clicks, for example, an image, text, or link (available values: <span style="font-family: Courier New,Courier,monospace;">enable</span> (default), <span style="font-family: Courier New,Courier,monospace;">disable</span>)</p></li>\r
        <li><span style="font-family: Courier New,Courier,monospace;">encryption</span> <p>Optional; Web application resources (HTML, JavaScript, and CSS files) are stored encrypted (available values: <span style="font-family: Courier New,Courier,monospace;">enable</span>, <span style="font-family: Courier New,Courier,monospace;">disable</span> (default))</p></li>\r
        <li><span style="font-family: Courier New,Courier,monospace;">screen-orientation</span><p>Optional; viewport orientation lock (available values: <span style="font-family: Courier New,Courier,monospace;">portrait</span> (default), <span style="font-family: Courier New,Courier,monospace;">landscape</span>), auto-rotation</p>If the system auto rotation setting is on, the Web application viewport orientation is changed accordingly by default.<p></p></li>\r
     </tr>\r
    </tbody>\r
   </table>\r
+  \r
+    <h3 id="mw_bg_category" name="mw_bg_category">Tizen Background Category</h3>\r
+  <table border="1">\r
+   <tbody>\r
+    <tr>\r
+     <th style="text-align:left;margin-left:auto;margin-right:auto;"> <p><span style="font-family: Courier New,Courier,monospace">&lt;tizen:background-category /&gt;</span> element</p></th>\r
+    </tr>\r
+    <tr>\r
+     <td> <p>Used to represent the categories of an application which is running in the background. </p>\r
+\r
+        <table class="note">\r
+   <tbody>\r
+    <tr>\r
+     <th class="note">Note</th>\r
+    </tr>\r
+    <tr>\r
+     <td class="note">Even if the <span style="font-family: Courier New,Courier,monospace">&lt;background-category /&gt;</span> element is declared in the config.xml file,  to run web applications in the background, <span style="font-family: Courier New,Courier,monospace">&lt;tizen:setting background-support&gt;</span> MUST be set to <span style="font-family: Courier New,Courier,monospace;">enable</span> in config.xml.\r
+    </td>\r
+    </tr>\r
+   </tbody>\r
+  </table>\r
 \r
+     <p><strong>Occurrences:</strong> </p>\r
+    <ul>\r
+       <li>0 or more</li>\r
+    </ul>\r
+     <p><strong>Attributes:</strong> </p>\r
+      <ul>\r
+       <li><span style="font-family: Courier New,Courier,monospace;">value</span> <p>Mandatory; <a href="../../../org.tizen.guides/html/native/app/application_n.htm#allow_bg">background-category list</a></p></li>\r
+      </ul><p><strong>Example:</strong> </p>\r
+         <pre class="prettyprint">&lt;tizen:background-category value=&quot;media&quot; /&gt;</pre> \r
+         </td>\r
+    </tr>\r
+   </tbody>\r
+  </table>\r
+  \r
     <h3 id="mw_feature" name="mw_feature">Tizen Feature</h3>\r
   <table border="1">\r
    <tbody>\r
         <p><strong>Attributes:</strong> </p> \r
       <ul> \r
      \r
-      <li><span style="font-family: Courier New,Courier,monospace;">background-support</span> <p>Optional; Sets whether Web Application is suspended when it goes to the background (available values: <span style="font-family: Courier New,Courier,monospace;">enable</span>, <span style="font-family: Courier New,Courier,monospace;">disable</span> (default))</p><p>If this option is enabled, Web Application is not suspended when it goes to the background.</p></li> \r
+      <li><span style="font-family: Courier New,Courier,monospace;">background-support</span> <p>Optional; Sets whether Web Application is suspended when it goes to the background (available values: <span style="font-family: Courier New,Courier,monospace;">enable</span>, <span style="font-family: Courier New,Courier,monospace;">disable</span> (default))</p><p>If this option is enabled, Web Application is not suspended when it goes to the background.</p>\r
+                <table class="note">\r
+                <tbody>\r
+                 <tr>\r
+                  <th class="note">Note</th>\r
+                 </tr>\r
+                 <tr>\r
+                  <td class="note">Since Tizen 2.4, background processes are managed more tightly by the system. Even if <span style="font-family: Courier New,Courier,monospace;">background-support</span> is set to <span style="font-family: Courier New,Courier,monospace;">enable</span>, the web application process which is moved to background may be suspended. To guarantee that a web application will run in the background, at least one background category should be added with the <span style="font-family: Courier New,Courier,monospace;">&lt;tizen:background-category&gt; </span>tag. Only background categories which have been declared in the system may be used.</td>\r
+                  </tr>\r
+                </tbody>\r
+               </table>\r
+         </li>\r
       <li><span style="font-family: Courier New,Courier,monospace;">context-menu</span> <p>Optional; Sets whether the context menu is shown (available values: <span style="font-family: Courier New,Courier,monospace;">enable</span> (default), <span style="font-family: Courier New,Courier,monospace;">disable</span>)</p><p>If this option is enabled, the context menu is visible to the user.</p></li>\r
       <li><span style="font-family: Courier New,Courier,monospace;">encryption</span> <p>Optional; Sets whether Web Application resources are encrypted (available values: <span style="font-family: Courier New,Courier,monospace;">enable</span> , <span style="font-family: Courier New,Courier,monospace;">  disable</span> (default))</p><p>If this option is enabled, the application resources(HTML, JS and CSS files) are encrypted.</p></li>\r
       <li><span style="font-family: Courier New,Courier,monospace;">screen-orientation</span> <p>Optional; Sets whether it locks orientation of Web Application (available values: <span style="font-family: Courier New,Courier,monospace;">portrait</span> (default), <span style="font-family: Courier New,Courier,monospace;">landscape</span>, <span style="font-family: Courier New,Courier,monospace;">  auto-rotation</span>)</p><p>If this option is portrait or landscape, the orientation is locked to portrait or landscape respectively.</p><p>If the option is auto-rotation, it follows device orientation setting.</p></li>\r
    </tbody> \r
   </table> \r
 \r
+      <h3 id="ww_bg_category" name="ww_bg_category">Tizen Background Category</h3>\r
+  <table border="1">\r
+   <tbody>\r
+    <tr>\r
+     <th style="text-align:left;margin-left:auto;margin-right:auto;"> <p><span style="font-family: Courier New,Courier,monospace">&lt;tizen:background-category /&gt;</span> element</p></th>\r
+    </tr>\r
+    <tr>\r
+     <td> <p>Used to represent the categories of an application which is running in the background. </p>\r
+\r
+        <table class="note">\r
+   <tbody>\r
+    <tr>\r
+     <th class="note">Note</th>\r
+    </tr>\r
+    <tr>\r
+     <td class="note">Even if the <span style="font-family: Courier New,Courier,monospace">&lt;background-category /&gt;</span> element is declared in the config.xml file,  to run web applications in the background, <span style="font-family: Courier New,Courier,monospace">&lt;tizen:setting background-support&gt;</span> MUST be set to <span style="font-family: Courier New,Courier,monospace;">enable</span> in config.xml.\r
+        </td>\r
+    </tr>\r
+   </tbody>\r
+  </table>\r
+\r
+     <p><strong>Occurrences:</strong> </p>\r
+    <ul>\r
+       <li>0 or more</li>\r
+    </ul>\r
+     <p><strong>Attributes:</strong> </p>\r
+      <ul>\r
+       <li><span style="font-family: Courier New,Courier,monospace;">value</span> <p>Mandatory; <a href="../../../org.tizen.guides/html/native/app/application_n.htm#allow_bg">background-category list</a></p></li>\r
+      </ul><p><strong>Example:</strong> </p>\r
+         <pre class="prettyprint">&lt;tizen:background-category value=&quot;media&quot; /&gt;</pre> \r
+         </td>\r
+    </tr>\r
+   </tbody>\r
+  </table>\r
+    \r
     <h3 id="ww_tizencontent" name="ww_tizencontent">Tizen Content</h3> \r
   <table border="1"> \r
    <tbody> \r
old mode 100644 (file)
new mode 100755 (executable)
index 50e020b..b5df235
@@ -505,6 +505,40 @@ var watchId = app.addEventListener({appId: "a234567890.TestWidget", name: "custo
 app.removeEventListener(watchId);
 </pre>
 
+<h2 id="background_category" name="background_category">Allowing Applications to Run in the Background</h2>
+
+<p>When a web application becomes invisible (moves to the background), the web application is suspended. To continue to execute a web application in the background, the
+<span style="font-family: Courier New,Courier,monospace">background-support</span> element of the <span style="font-family: Courier New,Courier,monospace">&lt;tizen:setting&gt; </span>tag must be explicitly set to <span style="font-family: Courier New,Courier,monospace">enable</span>.</P>
+
+<p>However since Tizen 2.4, the background process management policy has been changed. The system does not allow applications to run in the background except for when they are explicitly declared to do so. Background categories allow an application to run in the background. For more information on background categories, see</p>
+<a href="../../../native/app/application_n.htm#allow_bg">Allowed background application policy</a>
+
+<table class="note">
+     <tbody>
+      <tr>
+       <th class="note">Note</th>
+      </tr>
+      <tr>
+       <td class="note">To guarantee a web application will run in the background,  at least one <span style="font-family: Courier New,Courier,monospace">background-category</span> must be declared and the <span style="font-family: Courier New,Courier,monospace">background-support</span> element of the <span style="font-family: Courier New,Courier,monospace">&lt;tizen:setting&gt; </span>tag must be set  to <span style="font-family: Courier New,Courier,monospace">enable</span>  in the config.xml file.</td>
+      </tr>
+     </tbody>
+    </table>
+
+<p>The following config.xml exmaple shows how an application can be configured to run in the background:</p>
+<pre class="prettyprint">
+&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
+&lt;widget xmlns=&quot;http://www.w3.org/ns/widgets&quot; xmlns:tizen=&quot;http://tizen.org/ns/widgets&quot; id=&quot;http://yourdomain/BackgroundCategory&quot; version=&quot;1.0.0&quot; viewmodes=&quot;maximized&quot;&gt;
+&nbsp;&nbsp;&nbsp;&lt;tizen:application id=&quot;background.category&quot; package=&quot;background&quot; required_version=&quot;2.4&quot;/&gt;
+&nbsp;&nbsp;&nbsp;&lt;content src=&quot;index.html&quot;/&gt;
+&nbsp;&nbsp;&nbsp;&lt;icon src=&quot;icon.png&quot;/&gt;
+&nbsp;&nbsp;&nbsp;&lt;name&gt;BackgroundCategoryTest&lt;/name&gt;
+&nbsp;&nbsp;&nbsp;&lt;tizen:background-category value=&quot;media&quot;/&gt;
+&nbsp;&nbsp;&nbsp;&lt;tizen:background-category value=&quot;download&quot;/&gt;
+&nbsp;&nbsp;&nbsp;&lt;tizen:background-category value=&quot;background-network&quot;/&gt;
+&nbsp;&nbsp;&nbsp;&lt;tizen:setting background-support=&quot;enable&quot;/&gt;
+&lt;/widget&gt;
+</pre>
+
 <script type="text/javascript" src="../../../scripts/jquery.zclip.min.js"></script>
 <script type="text/javascript" src="../../../scripts/showhide.js"></script>
 </div></div></div>