[HAM] Widl updated, additional description for GPS batch feature
authorJakub Skowron <j.skowron@samsung.com>
Wed, 27 Apr 2016 10:03:49 +0000 (12:03 +0200)
committerJakub Skowron <j.skowron@samsung.com>
Wed, 27 Apr 2016 10:11:32 +0000 (12:11 +0200)
Change-Id: Iaa51fcec393e18b482e6e450337ebe3608daad6a
Signed-off-by: Piotr Kosko <p.kosko@samsung.com>
Signed-off-by: Jakub Skowron <j.skowron@samsung.com>
org.tizen.guides/html/web/tizen/system/ham_w.htm
org.tizen.tutorials/html/web/tizen/system/ham_tutorial_w.htm
org.tizen.web.apireference/html/device_api/mobile/tizen/humanactivitymonitor.html
org.tizen.web.apireference/html/device_api/wearable/tizen/humanactivitymonitor.html

index cd3a652..932e333 100644 (file)
@@ -22,9 +22,9 @@
     <div id="toc_border"><div id="toc">
         <p class="toc-title">Related Info</p>
         <ul class="toc">
-                       <li><a href="../../../../../org.tizen.tutorials/html/web/tizen/system/ham_tutorial_w.htm">Human Activity Monitor Tutorial</a></li>
-                       <li><a href="../../../../../org.tizen.web.apireference/html/device_api/mobile/tizen/humanactivitymonitor.html">Human Activity Monitor API for Mobile Web</a></li>
-                       <li><a href="../../../../../org.tizen.web.apireference/html/device_api/wearable/tizen/humanactivitymonitor.html">Human Activity Monitor API for Wearable Web</a></li>                   
+            <li><a href="../../../../../org.tizen.tutorials/html/web/tizen/system/ham_tutorial_w.htm">Human Activity Monitor Tutorial</a></li>
+            <li><a href="../../../../../org.tizen.web.apireference/html/device_api/mobile/tizen/humanactivitymonitor.html">Human Activity Monitor API for Mobile Web</a></li>
+            <li><a href="../../../../../org.tizen.web.apireference/html/device_api/wearable/tizen/humanactivitymonitor.html">Human Activity Monitor API for Wearable Web</a></li>
             </ul>
     </div></div>
 </div>
 
 <p>Tizen enables you to access the human activity data from various sensors on the device.</p>
 
-<p>The Human Activity Monitor API is optional for both Tizen mobile and wearable profiles, which means that it may not be supported in all mobile and wearable devices. The Human Activity Monitor API is partly supported on the Tizen Emulators (only heart-rate monitoring).</p> 
-  
+<p>The Human Activity Monitor API is optional for both Tizen mobile and wearable profiles, which means that it may not be supported in all mobile and wearable devices. The Human Activity Monitor API is partly supported on the Tizen Emulators (only heart-rate monitoring).</p>
+
 <p>The main features of the Human Activity Monitor API include:</p>
 <ul>
 <li>Retrieving data
 <p>You can <a href="../../../../../org.tizen.tutorials/html/web/tizen/system/ham_tutorial_w.htm#retrieve">collect monitor data</a>.</p></li>
+<li>Using user-definded intervals
+<p>You can <a href="../../../../../org.tizen.tutorials/html/web/tizen/system/ham_tutorial_w.htm#interval">change intervals for collecting data</a>.</p></li>
 <li>Receiving notifications
 <p>You can <a href="../../../../../org.tizen.tutorials/html/web/tizen/system/ham_tutorial_w.htm#receive">detect changes in the monitor data</a>.</p></li>
+<li>Activity recognition
+<p>You can <a href="../../../../../org.tizen.tutorials/html/web/tizen/system/ham_tutorial_w.htm#activity_recognition">recognize activities</a>.</p></li>
 </ul>
 <p>The supported monitor types and their capabilities are listed in the following table.</p>
 
-       <table id="ham_capabilities"> 
+    <table id="ham_capabilities">
    <caption>
      Table: Human activity monitors and capabilities
    </caption>
@@ -82,7 +86,7 @@
   </table>
 
 <p>When the pedometer, HRM, GPS and sleep monitor sensors are started, a change callback is invoked when data changes. Use the <span style="font-family: Courier New,Courier,monospace;">getHumanActivityData()</span> method to get current data.</p>
-<p>The GPS sensor provides both the current value and a short history of last recorded GPS positions.</p>
+<p>The GPS sensor provides both the current value and a short history of last recorded GPS positions. GPS sensor supports sampling intervals, which could be used to create more power efficient applications.</p>
 <p>The accumulative pedometer sensor does not have to be started by your application as long as step counting is enabled by any other application or the system. Listener registered with the <tt class=" "> setAccumulativePedometerListener</tt><tt class=" ">()</tt> method is called when accumulative counters are changed.</p>
 <p>The wrist up sensor is notified when the relevant gesture is performed. The sensor must be enabled using the <span style="font-family: Courier New,Courier,monospace;">start()</span> method. An event listener invoked when the gesture is detected. This sensor does not provide any data.</p>
 <p>
index 9ef10d2..815f87a 100644 (file)
         <p><img alt="Mobile Web" src="../../../images/mobile_s_w_optional.png"/> <img alt="Wearable Web" src="../../../images/wearable_s_w_optional.png"/></p>
     </div>
     <div id="toc_border"><div id="toc">
-               <p class="toc-title">Content</p>
+        <p class="toc-title">Content</p>
         <ul class="toc">
             <li><a href="#retrieve">Retrieving Data</a></li>
+            <li><a href="#interval">Using user-defined intervals</a></li>
             <li><a href="#receive">Receiving Notifications on Pedometer Data Changes</a></li>
             <li><a href="#activity_recognition">Activity Recognition</a></li>
             <li><a href="#sleep_monitor">Sleep Monitor</a></li>
@@ -30,8 +31,8 @@
         <p class="toc-title">Related Info</p>
         <ul class="toc">
             <li><a href="../../../../../org.tizen.guides/html/web/tizen/system/ham_w.htm">Human Activity Monitor Guide</a></li>
-                       <li><a href="../../../../../org.tizen.web.apireference/html/device_api/mobile/tizen/humanactivitymonitor.html">Human Activity Monitor API for Mobile Web</a></li>
-                       <li><a href="../../../../../org.tizen.web.apireference/html/device_api/wearable/tizen/humanactivitymonitor.html">Human Activity Monitor API for Wearable Web</a></li>                           
+            <li><a href="../../../../../org.tizen.web.apireference/html/device_api/mobile/tizen/humanactivitymonitor.html">Human Activity Monitor API for Mobile Web</a></li>
+            <li><a href="../../../../../org.tizen.web.apireference/html/device_api/wearable/tizen/humanactivitymonitor.html">Human Activity Monitor API for Wearable Web</a></li>
         </ul>
     </div></div>
 </div>
 
 <p>This tutorial demonstrates how you can monitor user activity.</p>
 
-<p>The Human Activity Monitor API is optional for both Tizen mobile and wearable profiles, which means that it may not be supported in all mobile and wearable devices. The Human Activity Monitor API is partly supported on the Tizen Emulators (only heart-rate monitoring).</p> 
+<p>The Human Activity Monitor API is optional for both Tizen mobile and wearable profiles, which means that it may not be supported in all mobile and wearable devices. The Human Activity Monitor API is partly supported on the Tizen Emulators (only heart-rate monitoring).</p>
 
 <h2>Warm-up</h2>
 
 <p>Become familiar with the Human Activity Monitor API basics by learning about:</p>
 <ul>
     <li><a href="#retrieve">Retrieving Data</a> <p>Start the data collection and get monitor data.</p></li>
+    <li><a href="#interval">Using user-defined intervals</a> <p>Define intervals for building more power efficient applications.</p></li>
     <li><a href="#receive">Receiving Notifications on Pedometer Data Changes</a> <p>Track the changes in the step count.</p></li>
     <li><a href="#activity_recognition">Activity Recognition</a><p>Recognizes activity and its accurance.</p></li>
     <li><a href="#sleep_monitor">Sleep monitor</a><p>Detects whether or not user is asleep.</p></li>
@@ -94,7 +96,28 @@ tizen.humanactivitymonitor.start(&quot;HRM&quot;, onchangedCB);</pre>
 
 tizen.humanactivitymonitor.start(&quot;WRIST_UP&quot;, onchangedCB)</pre>
 
-<p>If a human activity type allows setting the interval at which data is sent to the application or setting the sampling interval, the last parameter of the <span style="font-family: Courier New,Courier,monospace">start()</span> method, option, can be used to specify this information:</p>
+<li>When the a heart-rate monitor (HRM) is enabled, you can get the current data using the <span style="font-family: Courier New,Courier,monospace">getHumanActivityData()</span> method of the <span style="font-family: Courier New,Courier,monospace">HumanActivityMonitorManager</span> interface:
+<pre class="prettyprint">function onsuccessCB(hrmInfo)
+{
+&nbsp;&nbsp;&nbsp;console.log(&quot;Heart rate: &quot; + hrmInfo.heartRate);
+}
+function onerrorCB(error)
+{
+&nbsp;&nbsp;&nbsp;console.log(&quot;Error occurred: &quot; + error.message);
+}
+tizen.humanactivitymonitor.getHumanActivityData(&quot;HRM&quot;, onsuccessCB, onerrorCB);</pre>
+</li>
+
+<li>To disable HAM when it is no longer required, use the <span style="font-family: Courier New,Courier,monospace">stop()</span> method of the <span style="font-family: Courier New,Courier,monospace">HumanActivityMonitorManager</span> interface:
+<pre class="prettyprint">tizen.humanactivitymonitor.stop(&quot;HRM&quot;);</pre>
+</li>
+</ol>
+
+                <h2 id="interval" name="interval">Using user-defined intervals</h2>
+
+<p>Human Activity API allows user to choose own intervals for collecting samples in <a href="../../../../../org.tizen.web.apireference/html/device_api/mobile/tizen/humanactivitymonitor.html#HumanActivityMonitorOption">specified range</a>.
+Such functionality could be used to build more power efficient applications, which collects data (less often device gathers data -> less energy is used). Developer could change interval according to state of device, e.g. when display is turned off, then sampling interval could be less.
+If a human activity type allows setting the interval at which data is sent to the application or setting the sampling interval, the last parameter of the <span style="font-family: Courier New,Courier,monospace">start()</span> method, option, can be used to specify this information:</p>
 
 <pre class="prettyprint">var myCallbackInterval = 240000;
 var mySampleInterval = 10000;
@@ -111,23 +134,7 @@ var option = {&quot;callbackInterval&quot;: myCallbackInterval,
 tizen.humanactivitymonitor.start(&quot;GPS&quot;, onchangedCB, option);</pre>
 </li>
 
-<li>When the a heart-rate monitor (HRM) is enabled, you can get the current data using the <span style="font-family: Courier New,Courier,monospace">getHumanActivityData()</span> method of the <span style="font-family: Courier New,Courier,monospace">HumanActivityMonitorManager</span> interface:
-<pre class="prettyprint">function onsuccessCB(hrmInfo)
-{
-&nbsp;&nbsp;&nbsp;console.log(&quot;Heart rate: &quot; + hrmInfo.heartRate);
-}
-function onerrorCB(error)
-{
-&nbsp;&nbsp;&nbsp;console.log(&quot;Error occurred: &quot; + error.message);
-}
-tizen.humanactivitymonitor.getHumanActivityData(&quot;HRM&quot;, onsuccessCB, onerrorCB);</pre>
-</li>
 
-<li>To disable HAM when it is no longer required, use the <span style="font-family: Courier New,Courier,monospace">stop()</span> method of the <span style="font-family: Courier New,Courier,monospace">HumanActivityMonitorManager</span> interface:
-<pre class="prettyprint">tizen.humanactivitymonitor.stop(&quot;HRM&quot;);</pre>
-</li>
-</ol>
-          
                 <h2 id="receive" name="receive">Receiving Notifications on Pedometer Data Changes</h2>
 
 <p>Learning how to register a listener for accumulative allows you to monitor the step count maintained by the system without enabling the Pedometer sensor and the <span style="font-family: Courier New,Courier,monospace">PEDOMETER</span> monitor:</p>
index 7f9e203..1542851 100644 (file)
@@ -389,6 +389,9 @@ The <em>ErrorCallback</em> method is launched with these error types:
 That means that both <b>'http://tizen.org/privilege/healthinfo'</b> and <b>'http://tizen.org/privilege/location'</b> should be declared in the config.xml file for the GPS type.
 For other types, only <b>'http://tizen.org/privilege/healthinfo'</b> should be declared.
             </p>
+<p><span class="remark"> Remark : </span>
+ This function may fail if it is called before the sensor is ready. In case of interval-driven sensors, it is recommended to call the function after at least one sensor event is delivered. Otherwise, applications can retry to call this function to be sure that the sensor is ready.
+            </p>
 <div class="parameters">
 <p><span class="param">Parameters:</span></p>
 <ul>
@@ -443,6 +446,12 @@ For other types, only <b>'http://tizen.org/privilege/healthinfo'</b> should be d
  tizen.humanactivitymonitor.start("PEDOMETER", onchangedCB);
  </pre>
 </div>
+<div class="output">
+<span class="title"><p>Output example:</p></span><pre> From now on, you will be notified when the pedometer data changes.
+ Step status : WALKING
+ Cumulative total step count : 100
+ </pre>
+</div>
 </dd>
 <dt class="method" id="HumanActivityMonitorManager::start">
 <a class="backward-compatibility-anchor" name="::HumanActivityMonitor::HumanActivityMonitorManager::start"></a><code><b><span class="methodName">start</span></b></code>
@@ -531,6 +540,11 @@ For other types, only <b>'http://tizen.org/privilege/healthinfo'</b> should be d
  tizen.humanactivitymonitor.start("PEDOMETER", onchangedCB);
  </pre>
 </div>
+<div class="output">
+<span class="title"><p>Output example:</p></span><pre> Step status : WALKING
+ Cumulative total step count : 100
+ </pre>
+</div>
 <div class="example">
 <span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> function onchangedCB(info) {
      var gpsInfo = info.gpsInfo;
@@ -678,6 +692,11 @@ Note that the setAccumulativePedometerListener() method does not need to call th
  tizen.humanactivitymonitor.setAccumulativePedometerListener(onchangedCB);
  </pre>
 </div>
+<div class="output">
+<span class="title"><p>Output example:</p></span><pre> Step status : WALKING
+ Accumulative total step count : 100
+ </pre>
+</div>
 </dd>
 <dt class="method" id="HumanActivityMonitorManager::unsetAccumulativePedometerListener">
 <a class="backward-compatibility-anchor" name="::HumanActivityMonitor::HumanActivityMonitorManager::unsetAccumulativePedometerListener"></a><code><b><span class="methodName">unsetAccumulativePedometerListener</span></b></code>
@@ -790,6 +809,12 @@ The <em>ErrorCallback</em> method is launched with this error type:
  }
  </pre>
 </div>
+<div class="output">
+<span class="title"><p>Output example:</p></span><pre> type: WALKING
+ timestamp: 1456735296123
+ accuracy: MEDIUM
+ </pre>
+</div>
 </dd>
 <dt class="method" id="HumanActivityMonitorManager::removeActivityRecognitionListener">
 <a class="backward-compatibility-anchor" name="::HumanActivityMonitor::HumanActivityMonitorManager::removeActivityRecognitionListener"></a><code><b><span class="methodName">removeActivityRecognitionListener</span></b></code>
@@ -848,6 +873,12 @@ The <em>ErrorCallback</em> method is launched with this error type:
  }
  </pre>
 </div>
+<div class="output">
+<span class="title"><p>Output example:</p></span><pre> type: WALKING
+ timestamp: 1456735296123
+ accuracy: MEDIUM
+ </pre>
+</div>
 </dd>
 </dl>
 </div>
@@ -1345,7 +1376,10 @@ When a user takes off the watch device, the heartRate is set to -3. When a user
             Since: </span>
  3.0
           </p>
-        
+<p><span class="remark"> Remark : </span>
+ If the device's display is off, multiple callbacks consisting of sleep monitor data are all invoked at once at a device specific interval. There is a callback for each minute in the interval. For example, if the device's interval is 20 minutes, 20 callbacks will be invoked every 20 minutes. When the display is turned on, all callbacks which have not been invoked are invoked and the callback is invoked every one minute from then on. Therefore, if the display is turned on at 25 minutes, five callbacks will be invoked.
+          </p>
+
       <div class="attributes">
 <h4>Attributes</h4>
 <ul>
@@ -1399,6 +1433,9 @@ When a user takes off the watch device, the heartRate is set to -3. When a user
             Since: </span>
  3.0
             </p>
+<p><span class="remark"> Remark : </span>
+ The specified interval is only a suggested interval between sensor measurements. You will get at least one sensor measurement within the interval you specify, but the actual interval between sensor measurements can be affected by other applications and the system. To reduce the system overhead, it is recommended to set the longest interval that you can, because the system usually chooses the shortest interval among all intervals specified.
+            </p>
 </dd>
 <dt class="member" id="HumanActivityMonitorOption::sampleInterval"><span class="attrName">long? sampleInterval</span></dt>
 <dd>
@@ -1570,7 +1607,7 @@ To guarantee that the human sleep state tracking application runs on a device wi
 <li class="feature">http://tizen.org/feature/sensor.sleep_monitor</li>
 </div>
 <p></p>
-                    For more information, see <a href="https://developer.tizen.org/development/getting-started/web-application/understanding-tizen-programming/application-filtering">Application Filtering</a>.
+                    For more information, see <a href="https://developer.tizen.org/development/getting-started/web-application/understanding-tizen-programming/application-filtering">Application Filtering.</a>
 </div>
 <h2 id="full-webidl">4. Full WebIDL</h2>
 <pre class="webidl prettyprint">module HumanActivityMonitor {
index b925f44..7b4801b 100644 (file)
@@ -23,7 +23,7 @@ Set up callbacks for data change notification          </li>
 Get current human activity monitor data          </li>
         </ul>
         <p>
-For more information about how to use Human Activity Monitor API, see <a href="https://developer.tizen.org/development/guides/web-application/tizen-features/system/human-activity-monitor">Human Activity Monitor Guide</a>.
+For more information about how to use Human Activity Monitor API, see <a href="https://developer.tizen.org/development/guides/web-application/tizen-features/system/human-activity-monitor">HumanActivityMonitor Guide</a>.
         </p>
        </div>
 <p><span class="version">
@@ -391,6 +391,9 @@ In other types, only <b>'http://tizen.org/privilege/healthinfo'</b> should be de
 <p><span class="remark"> Remark : </span>
  This function may fail if it is called before the sensor is ready. In case of interval-driven sensors, it is recommended to call the function after at least one sensor event is delivered. Otherwise, applications can retry to call this function to be sure that the sensor is ready.
             </p>
+<p><span class="remark"> Remark : </span>
+ This function may fail if it is called before the sensor is ready. In case of interval-driven sensors, it is recommended to call the function after at least one sensor event is delivered. Otherwise, applications can retry to call this function to be sure that the sensor is ready.
+            </p>
 <div class="parameters">
 <p><span class="param">Parameters:</span></p>
 <ul>
@@ -445,6 +448,12 @@ In other types, only <b>'http://tizen.org/privilege/healthinfo'</b> should be de
  tizen.humanactivitymonitor.start("PEDOMETER", onchangedCB);
  </pre>
 </div>
+<div class="output">
+<span class="title"><p>Output example:</p></span><pre> From now on, you will be notified when the pedometer data changes.
+ Step status : WALKING
+ Cumulative total step count : 100
+ </pre>
+</div>
 </dd>
 <dt class="method" id="HumanActivityMonitorManager::start">
 <a class="backward-compatibility-anchor" name="::HumanActivityMonitor::HumanActivityMonitorManager::start"></a><code><b><span class="methodName">start</span></b></code>
@@ -533,6 +542,11 @@ In other types, only <b>'http://tizen.org/privilege/healthinfo'</b> should be de
  tizen.humanactivitymonitor.start("PEDOMETER", onchangedCB);
  </pre>
 </div>
+<div class="output">
+<span class="title"><p>Output example:</p></span><pre> Step status : WALKING
+ Cumulative total step count : 100
+ </pre>
+</div>
 <div class="example">
 <span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> function onchangedCB(info) {
      var gpsInfo = info.gpsInfo;
@@ -680,6 +694,11 @@ Note that the setAccumulativePedometerListener() method does not need to call th
  tizen.humanactivitymonitor.setAccumulativePedometerListener(onchangedCB);
  </pre>
 </div>
+<div class="output">
+<span class="title"><p>Output example:</p></span><pre> Step status : WALKING
+ Accumulative total step count : 100
+ </pre>
+</div>
 </dd>
 <dt class="method" id="HumanActivityMonitorManager::unsetAccumulativePedometerListener">
 <a class="backward-compatibility-anchor" name="::HumanActivityMonitor::HumanActivityMonitorManager::unsetAccumulativePedometerListener"></a><code><b><span class="methodName">unsetAccumulativePedometerListener</span></b></code>
@@ -1359,6 +1378,9 @@ When a user takes off the watch device, the heartRate is set to -3. When a user
             Since: </span>
  3.0
           </p>
+<p><span class="remark"> Remark : </span>
+ If the device's display is off, multiple callbacks consisting of sleep monitor data are all invoked at once at a device specific interval. There is a callback for each minute in the interval. For example, if the device's interval is 20 minutes, 20 callbacks will be invoked every 20 minutes. When the display is turned on, all callbacks which have not been invoked are invoked and the callback is invoked every one minute from then on. Therefore, if the display is turned on at 25 minutes, five callbacks will be invoked.
+          </p>
 
       <div class="attributes">
 <h4>Attributes</h4>
@@ -1586,7 +1608,7 @@ To guarantee that the human sleep state tracking application runs on a device wi
 <li class="feature">http://tizen.org/feature/sensor.sleep_monitor</li>
 </div>
 <p></p>
-                    For more information, see <a href="https://developer.tizen.org/development/getting-started/web-application/understanding-tizen-programming/application-filtering">Application Filtering</a>.
+                    For more information, see <a href="https://developer.tizen.org/development/getting-started/web-application/understanding-tizen-programming/application-filtering">Application Filtering.</a>
 </div>
 <h2 id="full-webidl">4. Full WebIDL</h2>
 <pre class="webidl prettyprint">module HumanActivityMonitor {