<th>Sensor</th>
<th>Capability</th>
</tr>
+ <tr>
+ <td>Acceleration sensor</td>
+ <td><code>http://tizen.org/feature/sensor.accelerometer</code></td>
+ </tr>
<tr>
<td>Gravity sensor</td>
<td><code>http://tizen.org/feature/sensor.gravity</code></td>
<td>2.2.1</td>
</tr>
<tr>
+<td><code>http://tizen.org/feature/sensor.accelerometer</code></td>
+ <td>Specify this key, if the application requires an acceleration sensor.</td>
+ <td>4.0</td>
+ </tr>
+<tr>
<td><code>http://tizen.org/feature/sensor.barometer</code></td>
<td>Specify this key, if the application requires a barometer sensor for using the <a href="../../../../org.tizen.web.apireference/html/device_api/mobile/tizen/sensor.html">Sensor</a> (Pressure Type) API.</td>
<td>2.2.1</td>
<td>2.2.1</td>
</tr>
<tr>
+<td><code>http://tizen.org/feature/sensor.accelerometer</code></td>
+ <td>Specify this key, if the application requires an acceleration sensor.</td>
+ <td>4.0</td>
+ </tr>
+<tr>
<td><code>http://tizen.org/feature/sensor.barometer</code></td>
<td>Specify this key, if the application requires a barometer sensor.</td>
<td>2.2.1</td>
</li>
<li>2.3. <a href="#Sensor">Sensor</a>
</li>
-<li>2.4. <a href="#GravitySensor">GravitySensor</a>
+<li>2.4. <a href="#AccelerationSensor">AccelerationSensor</a>
</li>
-<li>2.5. <a href="#GyroscopeSensor">GyroscopeSensor</a>
+<li>2.5. <a href="#GravitySensor">GravitySensor</a>
</li>
-<li>2.6. <a href="#GyroscopeRotationVectorSensor">GyroscopeRotationVectorSensor</a>
+<li>2.6. <a href="#GyroscopeSensor">GyroscopeSensor</a>
</li>
-<li>2.7. <a href="#GyroscopeUncalibratedSensor">GyroscopeUncalibratedSensor</a>
+<li>2.7. <a href="#GyroscopeRotationVectorSensor">GyroscopeRotationVectorSensor</a>
</li>
-<li>2.8. <a href="#HRMRawSensor">HRMRawSensor</a>
+<li>2.8. <a href="#GyroscopeUncalibratedSensor">GyroscopeUncalibratedSensor</a>
</li>
-<li>2.9. <a href="#LightSensor">LightSensor</a>
+<li>2.9. <a href="#HRMRawSensor">HRMRawSensor</a>
</li>
-<li>2.10. <a href="#LinearAccelerationSensor">LinearAccelerationSensor</a>
+<li>2.10. <a href="#LightSensor">LightSensor</a>
</li>
-<li>2.11. <a href="#MagneticSensor">MagneticSensor</a>
+<li>2.11. <a href="#LinearAccelerationSensor">LinearAccelerationSensor</a>
</li>
-<li>2.12. <a href="#MagneticUncalibratedSensor">MagneticUncalibratedSensor</a>
+<li>2.12. <a href="#MagneticSensor">MagneticSensor</a>
</li>
-<li>2.13. <a href="#PressureSensor">PressureSensor</a>
+<li>2.13. <a href="#MagneticUncalibratedSensor">MagneticUncalibratedSensor</a>
</li>
-<li>2.14. <a href="#ProximitySensor">ProximitySensor</a>
+<li>2.14. <a href="#PressureSensor">PressureSensor</a>
</li>
-<li>2.15. <a href="#UltravioletSensor">UltravioletSensor</a>
+<li>2.15. <a href="#ProximitySensor">ProximitySensor</a>
</li>
-<li>2.16. <a href="#SensorData">SensorData</a>
+<li>2.16. <a href="#UltravioletSensor">UltravioletSensor</a>
</li>
-<li>2.17. <a href="#SensorGravityData">SensorGravityData</a>
+<li>2.17. <a href="#SensorData">SensorData</a>
</li>
-<li>2.18. <a href="#SensorGyroscopeData">SensorGyroscopeData</a>
+<li>2.18. <a href="#SensorAccelerationData">SensorAccelerationData</a>
</li>
-<li>2.19. <a href="#SensorGyroscopeRotationVectorData">SensorGyroscopeRotationVectorData</a>
+<li>2.19. <a href="#SensorGravityData">SensorGravityData</a>
</li>
-<li>2.20. <a href="#SensorGyroscopeUncalibratedData">SensorGyroscopeUncalibratedData</a>
+<li>2.20. <a href="#SensorGyroscopeData">SensorGyroscopeData</a>
</li>
-<li>2.21. <a href="#SensorHRMRawData">SensorHRMRawData</a>
+<li>2.21. <a href="#SensorGyroscopeRotationVectorData">SensorGyroscopeRotationVectorData</a>
</li>
-<li>2.22. <a href="#SensorLightData">SensorLightData</a>
+<li>2.22. <a href="#SensorGyroscopeUncalibratedData">SensorGyroscopeUncalibratedData</a>
</li>
-<li>2.23. <a href="#SensorLinearAccelerationData">SensorLinearAccelerationData</a>
+<li>2.23. <a href="#SensorHRMRawData">SensorHRMRawData</a>
</li>
-<li>2.24. <a href="#SensorMagneticData">SensorMagneticData</a>
+<li>2.24. <a href="#SensorLightData">SensorLightData</a>
</li>
-<li>2.25. <a href="#SensorMagneticUncalibratedData">SensorMagneticUncalibratedData</a>
+<li>2.25. <a href="#SensorLinearAccelerationData">SensorLinearAccelerationData</a>
</li>
-<li>2.26. <a href="#SensorPressureData">SensorPressureData</a>
+<li>2.26. <a href="#SensorMagneticData">SensorMagneticData</a>
</li>
-<li>2.27. <a href="#SensorProximityData">SensorProximityData</a>
+<li>2.27. <a href="#SensorMagneticUncalibratedData">SensorMagneticUncalibratedData</a>
</li>
-<li>2.28. <a href="#SensorUltravioletData">SensorUltravioletData</a>
+<li>2.28. <a href="#SensorPressureData">SensorPressureData</a>
</li>
-<li>2.29. <a href="#SensorHardwareInfo">SensorHardwareInfo</a>
+<li>2.29. <a href="#SensorProximityData">SensorProximityData</a>
</li>
-<li>2.30. <a href="#SensorDataSuccessCallback">SensorDataSuccessCallback</a>
+<li>2.30. <a href="#SensorUltravioletData">SensorUltravioletData</a>
</li>
-<li>2.31. <a href="#SensorHardwareInfoSuccessCallback">SensorHardwareInfoSuccessCallback</a>
+<li>2.31. <a href="#SensorHardwareInfo">SensorHardwareInfo</a>
+</li>
+<li>2.32. <a href="#SensorDataSuccessCallback">SensorDataSuccessCallback</a>
+</li>
+<li>2.33. <a href="#SensorHardwareInfoSuccessCallback">SensorHardwareInfoSuccessCallback</a>
</li>
</ul>
</li>
</td>
</tr>
<tr>
+<td><a href="#AccelerationSensor">AccelerationSensor</a></td>
+<td><div>void <a href="#AccelerationSensor::getAccelerationSensorData">getAccelerationSensorData</a> (<a href="#SensorDataSuccessCallback">SensorDataSuccessCallback</a> successCallback, optional <a href="tizen.html#ErrorCallback">ErrorCallback</a>? errorCallback)</div></td>
+</tr>
+<tr>
<td><a href="#GravitySensor">GravitySensor</a></td>
<td><div>void <a href="#GravitySensor::getGravitySensorData">getGravitySensorData</a> (<a href="#SensorDataSuccessCallback">SensorDataSuccessCallback</a> successCallback, optional <a href="tizen.html#ErrorCallback">ErrorCallback</a>? errorCallback)</div></td>
</tr>
<td></td>
</tr>
<tr>
+<td><a href="#SensorAccelerationData">SensorAccelerationData</a></td>
+<td></td>
+</tr>
+<tr>
<td><a href="#SensorGravityData">SensorGravityData</a></td>
<td></td>
</tr>
<div class="brief">
Specifies the sensor type available to the API.
</div>
-<pre class="webidl prettyprint"> enum SensorType { "GRAVITY", "GYROSCOPE", "GYROSCOPE_ROTATION_VECTOR", "GYROSCOPE_UNCALIBRATED", "HRM_RAW", "LIGHT", "LINEAR_ACCELERATION", "MAGNETIC",
+<pre class="webidl prettyprint"> enum SensorType { "ACCELERATION", "GRAVITY", "GYROSCOPE", "GYROSCOPE_ROTATION_VECTOR", "GYROSCOPE_UNCALIBRATED", "HRM_RAW", "LIGHT", "LINEAR_ACCELERATION", "MAGNETIC",
"MAGNETIC_UNCALIBRATED", "PRESSURE", "PROXIMITY", "ULTRAVIOLET" };</pre>
<p><span class="version">
Since: </span>
</p>
<ul>
<li>
+ACCELERATION - Acceleration sensor </li>
+ <li>
GRAVITY - Gravity sensor </li>
<li>
GYROSCOPE - Gyroscope sensor </li>
<em>GRAVITY</em>, <em>GYROSCOPE</em>, <em>GYROSCOPE_ROTATION_VECTOR</em> and <em>LINEAR ACCELERATION</em> are supported since Tizen 3.0
</p>
<p><span class="remark"> Remark : </span>
- <em>GYROSCOPE_UNCALIBRATED</em> and <em>MAGNETIC_UNCALIBRATED</em> are supported since Tizen 4.0
+ <em>ACCELERATION</em>, <em>GYROSCOPE_UNCALIBRATED</em> and <em>MAGNETIC_UNCALIBRATED</em> are supported since Tizen 4.0
</p>
</div>
</div>
</p>
<ul>
<li>
+ ACCELERATION - tizen.systeminfo.getCapability(<em>"http://tizen.org/feature/sensor.accelerometer"</em>) </li>
+ <li>
GRAVITY - tizen.systeminfo.getCapability(<em>"http://tizen.org/feature/sensor.gravity"</em>) </li>
<li>
GYROSCOPE - tizen.systeminfo.getCapability(<em>"http://tizen.org/feature/sensor.gyroscope"</em>) </li>
</dl>
</div>
</div>
+<div class="interface" id="AccelerationSensor">
+<a class="backward-compatibility-anchor" name="::Sensor::AccelerationSensor"></a><h3>2.4. AccelerationSensor</h3>
+<div class="brief">
+ The AccelerationSensor interface provides methods to access accelerometer data.
+ </div>
+<pre class="webidl prettyprint"> [NoInterfaceObject] interface AccelerationSensor : <a href="#Sensor">Sensor</a> {
+
+ void getAccelerationSensorData(<a href="#SensorDataSuccessCallback">SensorDataSuccessCallback</a> successCallback,
+ optional <a href="tizen.html#ErrorCallback">ErrorCallback</a>? errorCallback) raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
+ };</pre>
+<p><span class="version">
+ Since: </span>
+ 4.0
+ </p>
+
+ <div class="methods">
+<h4>Methods</h4>
+<dl>
+<dt class="method" id="AccelerationSensor::getAccelerationSensorData">
+<a class="backward-compatibility-anchor" name="::Sensor::AccelerationSensor::getAccelerationSensorData"></a><code><b><span class="methodName">getAccelerationSensorData</span></b></code>
+</dt>
+<dd>
+<div class="brief">
+ Gets the current acceleration sensor data. You can refer to <a href="sensor.html#SensorAccelerationData">SensorAccelerationData</a> interface.
+ </div>
+<div class="synopsis"><pre class="signature prettyprint">void getAccelerationSensorData(<a href="#SensorDataSuccessCallback">SensorDataSuccessCallback</a> successCallback, optional <a href="tizen.html#ErrorCallback">ErrorCallback</a>? errorCallback);
+ </pre></div>
+<p><span class="version">
+ Since: </span>
+ 4.0
+ </p>
+<div class="description">
+ <p>
+Note that before calling the getAccelerationSensorData() method, the start() method should be called to turn the sensor on.
+ </p>
+ <p>
+The <em>ErrorCallback</em> method is launched with these error types:
+ </p>
+ <ul>
+ <li>
+ ServiceNotAvailableError : If the <em>getAccelerationSensorData()</em> method is called without first calling the <em>start()</em> method </li>
+ <li>
+ AbortError : If the system operation was aborted </li>
+ </ul>
+ </div>
+<div class="parameters">
+<p><span class="param">Parameters:</span></p>
+<ul>
+ <li class="param">
+<span class="name">successCallback</span>:
+ Callback method to be invoked when the sensor data has been read
+ </li>
+ <li class="param">
+<span class="name">errorCallback</span><span class="optional"> [optional]</span><span class="optional"> [nullable]</span>:
+ Callback method to be invoked when an error occurs
+ </li>
+ </ul>
+</div>
+<div class="exceptionlist">
+<p><span class="except">Exceptions:</span></p>
+ <ul class="exception"><li>WebAPIException<ul><li class="list"><p>
+ with error type TypeMismatchError, if any input parameter is not compatible with the expected type for that parameter.
+ </p></li></ul>
+</li></ul>
+ </div>
+<div class="example">
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> var accelerationSensor = tizen.sensorservice.getDefaultSensor("ACCELERATION");
+
+ function onGetSuccessCB(sensorData)
+ {
+ console.log("######## Get acceleration sensor data ########");
+ console.log("x: " + sensorData.x);
+ console.log("y: " + sensorData.y);
+ console.log("z: " + sensorData.z);
+ }
+
+ function onerrorCB(error)
+ {
+ console.log("error occurred: " + error.message);
+ }
+
+ function onsuccessCB()
+ {
+ console.log("acceleration sensor start");
+ accelerationSensor.getAccelerationSensorData(onGetSuccessCB, onerrorCB);
+ }
+
+ accelerationSensor.start(onsuccessCB);
+ </pre>
+</div>
+<div class="output">
+<span class="title"><p>Output example:</p></span><pre> acceleration sensor start
+ ######## Get acceleration sensor data ########
+ x: -4.311866283416748
+ y: 8.6243314743042
+ z: 2.841476917266846
+ </pre>
+</div>
+</dd>
+</dl>
+</div>
+</div>
<div class="interface" id="GravitySensor">
-<a class="backward-compatibility-anchor" name="::Sensor::GravitySensor"></a><h3>2.4. GravitySensor</h3>
+<a class="backward-compatibility-anchor" name="::Sensor::GravitySensor"></a><h3>2.5. GravitySensor</h3>
<div class="brief">
The GravitySensor interface provides methods to access gravity sensor data.
</div>
</div>
</div>
<div class="interface" id="GyroscopeSensor">
-<a class="backward-compatibility-anchor" name="::Sensor::GyroscopeSensor"></a><h3>2.5. GyroscopeSensor</h3>
+<a class="backward-compatibility-anchor" name="::Sensor::GyroscopeSensor"></a><h3>2.6. GyroscopeSensor</h3>
<div class="brief">
The GyroscopeSensor interface provides methods to access gyroscope sensor data.
</div>
</div>
</div>
<div class="interface" id="GyroscopeRotationVectorSensor">
-<a class="backward-compatibility-anchor" name="::Sensor::GyroscopeRotationVectorSensor"></a><h3>2.6. GyroscopeRotationVectorSensor</h3>
+<a class="backward-compatibility-anchor" name="::Sensor::GyroscopeRotationVectorSensor"></a><h3>2.7. GyroscopeRotationVectorSensor</h3>
<div class="brief">
The GyroscopeRotationVectorSensor interface provides methods to access gyroscope rotation vector sensor data.
</div>
</div>
</div>
<div class="interface" id="GyroscopeUncalibratedSensor">
-<a class="backward-compatibility-anchor" name="::Sensor::GyroscopeUncalibratedSensor"></a><h3>2.7. GyroscopeUncalibratedSensor</h3>
+<a class="backward-compatibility-anchor" name="::Sensor::GyroscopeUncalibratedSensor"></a><h3>2.8. GyroscopeUncalibratedSensor</h3>
<div class="brief">
The GyroscopeUncalibratedSensor interface provides methods to access uncalibrated gyroscope sensor data.
</div>
</div>
</div>
<div class="interface" id="HRMRawSensor">
-<a class="backward-compatibility-anchor" name="::Sensor::HRMRawSensor"></a><h3>2.8. HRMRawSensor</h3>
+<a class="backward-compatibility-anchor" name="::Sensor::HRMRawSensor"></a><h3>2.9. HRMRawSensor</h3>
<div class="brief">
The HRMRawSensor interface provides methods to access HRM sensor raw data.
</div>
</div>
</div>
<div class="interface" id="LightSensor">
-<a class="backward-compatibility-anchor" name="::Sensor::LightSensor"></a><h3>2.9. LightSensor</h3>
+<a class="backward-compatibility-anchor" name="::Sensor::LightSensor"></a><h3>2.10. LightSensor</h3>
<div class="brief">
The LightSensor interface provides methods to access light sensor data.
</div>
</div>
</div>
<div class="interface" id="LinearAccelerationSensor">
-<a class="backward-compatibility-anchor" name="::Sensor::LinearAccelerationSensor"></a><h3>2.10. LinearAccelerationSensor</h3>
+<a class="backward-compatibility-anchor" name="::Sensor::LinearAccelerationSensor"></a><h3>2.11. LinearAccelerationSensor</h3>
<div class="brief">
The LinearAccelerationSensor interface provides methods to access linear acceleration sensor data.
</div>
</div>
</div>
<div class="interface" id="MagneticSensor">
-<a class="backward-compatibility-anchor" name="::Sensor::MagneticSensor"></a><h3>2.11. MagneticSensor</h3>
+<a class="backward-compatibility-anchor" name="::Sensor::MagneticSensor"></a><h3>2.12. MagneticSensor</h3>
<div class="brief">
The MagneticSensor interface provides methods to access magnetic sensor data.
</div>
</div>
</div>
<div class="interface" id="MagneticUncalibratedSensor">
-<a class="backward-compatibility-anchor" name="::Sensor::MagneticUncalibratedSensor"></a><h3>2.12. MagneticUncalibratedSensor</h3>
+<a class="backward-compatibility-anchor" name="::Sensor::MagneticUncalibratedSensor"></a><h3>2.13. MagneticUncalibratedSensor</h3>
<div class="brief">
The MagneticUncalibratedSensor interface provides methods to access uncalibrated magnetic sensor data.
</div>
</div>
</div>
<div class="interface" id="PressureSensor">
-<a class="backward-compatibility-anchor" name="::Sensor::PressureSensor"></a><h3>2.13. PressureSensor</h3>
+<a class="backward-compatibility-anchor" name="::Sensor::PressureSensor"></a><h3>2.14. PressureSensor</h3>
<div class="brief">
The PressureSensor interface provides methods to access pressure sensor data.
</div>
</div>
</div>
<div class="interface" id="ProximitySensor">
-<a class="backward-compatibility-anchor" name="::Sensor::ProximitySensor"></a><h3>2.14. ProximitySensor</h3>
+<a class="backward-compatibility-anchor" name="::Sensor::ProximitySensor"></a><h3>2.15. ProximitySensor</h3>
<div class="brief">
The ProximitySensor interface provides methods to access proximity sensor data.
</div>
</div>
</div>
<div class="interface" id="UltravioletSensor">
-<a class="backward-compatibility-anchor" name="::Sensor::UltravioletSensor"></a><h3>2.15. UltravioletSensor</h3>
+<a class="backward-compatibility-anchor" name="::Sensor::UltravioletSensor"></a><h3>2.16. UltravioletSensor</h3>
<div class="brief">
The UltravioletSensor interface provides methods to access ultraviolet sensor data.
</div>
</div>
</div>
<div class="interface" id="SensorData">
-<a class="backward-compatibility-anchor" name="::Sensor::SensorData"></a><h3>2.16. SensorData</h3>
+<a class="backward-compatibility-anchor" name="::Sensor::SensorData"></a><h3>2.17. SensorData</h3>
<div class="brief">
The SensorData interface is a common abstract interface used by different types of sensor data objects.
</div>
2.3
</p>
</div>
+<div class="interface" id="SensorAccelerationData">
+<a class="backward-compatibility-anchor" name="::Sensor::SensorAccelerationData"></a><h3>2.18. SensorAccelerationData</h3>
+<div class="brief">
+ The SensorAccelerationData interface represents acceleration sensor data. You can refer to <a href="https://developer.tizen.org/development/guides/native-application/system/sensor#accelerometer">this guide</a> to learn more about acceleration sensor data.
+ </div>
+<pre class="webidl prettyprint"> [NoInterfaceObject] interface SensorAccelerationData : <a href="#SensorData">SensorData</a> {
+
+ readonly attribute double x;
+
+ readonly attribute double y;
+
+ readonly attribute double z;
+ };</pre>
+<p><span class="version">
+ Since: </span>
+ 4.0
+ </p>
+<div class="description">
+ <p>
+The acceleration sensor data represents the sum of acceleration of the device and an acceleration component representing forces opposing the gravity.
+ </p>
+ </div>
+<p><span class="remark"> Remark : </span>
+ An example of how to access and use this interface can be found in the <a href="sensor.html#AccelerationSensor::getAccelerationSensorData">getAccelerationSensorData()</a> code example.
+ </p>
+
+ <div class="attributes">
+<h4>Attributes</h4>
+<ul>
+<li class="attribute" id="SensorAccelerationData::x">
+<span class="attrName"><span class="readonly"> readonly
+</span><span class="type">double </span><span class="name">x</span></span><div class="brief">
+ The result of acceleration sensor measurement in the device's X axis in m/s².<br>The value can be between -19.6 and 19.6 inclusive.
+ </div>
+<p><span class="version">
+ Since: </span>
+ 4.0
+ </p>
+</li>
+<li class="attribute" id="SensorAccelerationData::y">
+<span class="attrName"><span class="readonly"> readonly
+</span><span class="type">double </span><span class="name">y</span></span><div class="brief">
+ The result of acceleration sensor measurement in the device's Y axis in m/s².<br>The value can be between -19.6 and 19.6 inclusive.
+ </div>
+<p><span class="version">
+ Since: </span>
+ 4.0
+ </p>
+</li>
+<li class="attribute" id="SensorAccelerationData::z">
+<span class="attrName"><span class="readonly"> readonly
+</span><span class="type">double </span><span class="name">z</span></span><div class="brief">
+ The result of acceleration sensor measurement in the device's Z axis in m/s².<br>The value can be between -19.6 and 19.6 inclusive.
+ </div>
+<p><span class="version">
+ Since: </span>
+ 4.0
+ </p>
+</li>
+</ul>
+</div>
+</div>
<div class="interface" id="SensorGravityData">
-<a class="backward-compatibility-anchor" name="::Sensor::SensorGravityData"></a><h3>2.17. SensorGravityData</h3>
+<a class="backward-compatibility-anchor" name="::Sensor::SensorGravityData"></a><h3>2.19. SensorGravityData</h3>
<div class="brief">
The SensorGravityData interface represents gravity sensor data. You can refer to <a href="https://developer.tizen.org/development/guides/native-application/system/sensor#gravity">this guide</a> to learn more about gravity sensor data.
</div>
</div>
</div>
<div class="interface" id="SensorGyroscopeData">
-<a class="backward-compatibility-anchor" name="::Sensor::SensorGyroscopeData"></a><h3>2.18. SensorGyroscopeData</h3>
+<a class="backward-compatibility-anchor" name="::Sensor::SensorGyroscopeData"></a><h3>2.20. SensorGyroscopeData</h3>
<div class="brief">
The SensorGyroscopeData interface represents gyroscope sensor data. You can refer to <a href="https://developer.tizen.org/development/guides/native-application/system/sensor#gyro">this guide</a> to learn more about gyroscope sensor data.
</div>
</div>
</div>
<div class="interface" id="SensorGyroscopeRotationVectorData">
-<a class="backward-compatibility-anchor" name="::Sensor::SensorGyroscopeRotationVectorData"></a><h3>2.19. SensorGyroscopeRotationVectorData</h3>
+<a class="backward-compatibility-anchor" name="::Sensor::SensorGyroscopeRotationVectorData"></a><h3>2.21. SensorGyroscopeRotationVectorData</h3>
<div class="brief">
The SensorGyroscopeRotationVectorData interface represents gyroscope rotation vector sensor data. You can refer to <a href="https://developer.tizen.org/development/guides/native-application/system/sensor#gyro_rotation">this guide</a> to learn more about gyroscope sensor data.
</div>
</div>
</div>
<div class="interface" id="SensorGyroscopeUncalibratedData">
-<a class="backward-compatibility-anchor" name="::Sensor::SensorGyroscopeUncalibratedData"></a><h3>2.20. SensorGyroscopeUncalibratedData</h3>
+<a class="backward-compatibility-anchor" name="::Sensor::SensorGyroscopeUncalibratedData"></a><h3>2.22. SensorGyroscopeUncalibratedData</h3>
<div class="brief">
The SensorGyroscopeUncalibratedData interface represents uncalibrated gyroscope sensor data.
</div>
</div>
</div>
<div class="interface" id="SensorHRMRawData">
-<a class="backward-compatibility-anchor" name="::Sensor::SensorHRMRawData"></a><h3>2.21. SensorHRMRawData</h3>
+<a class="backward-compatibility-anchor" name="::Sensor::SensorHRMRawData"></a><h3>2.23. SensorHRMRawData</h3>
<div class="brief">
The SensorHRMRawData interface represents HRM sensor raw data.
</div>
</div>
</div>
<div class="interface" id="SensorLightData">
-<a class="backward-compatibility-anchor" name="::Sensor::SensorLightData"></a><h3>2.22. SensorLightData</h3>
+<a class="backward-compatibility-anchor" name="::Sensor::SensorLightData"></a><h3>2.24. SensorLightData</h3>
<div class="brief">
The SensorLightData interface represents light sensor data.
</div>
</div>
</div>
<div class="interface" id="SensorLinearAccelerationData">
-<a class="backward-compatibility-anchor" name="::Sensor::SensorLinearAccelerationData"></a><h3>2.23. SensorLinearAccelerationData</h3>
+<a class="backward-compatibility-anchor" name="::Sensor::SensorLinearAccelerationData"></a><h3>2.25. SensorLinearAccelerationData</h3>
<div class="brief">
The SensorLinearAccelerationData interface represents linear acceleration sensor data.
</div>
</div>
</div>
<div class="interface" id="SensorMagneticData">
-<a class="backward-compatibility-anchor" name="::Sensor::SensorMagneticData"></a><h3>2.24. SensorMagneticData</h3>
+<a class="backward-compatibility-anchor" name="::Sensor::SensorMagneticData"></a><h3>2.26. SensorMagneticData</h3>
<div class="brief">
The SensorMagneticData interface represents magnetic sensor data.
</div>
</div>
</div>
<div class="interface" id="SensorMagneticUncalibratedData">
-<a class="backward-compatibility-anchor" name="::Sensor::SensorMagneticUncalibratedData"></a><h3>2.25. SensorMagneticUncalibratedData</h3>
+<a class="backward-compatibility-anchor" name="::Sensor::SensorMagneticUncalibratedData"></a><h3>2.27. SensorMagneticUncalibratedData</h3>
<div class="brief">
The SensorMagneticUncalibratedData interface represents uncalibrated magnetic sensor data.
</div>
</div>
</div>
<div class="interface" id="SensorPressureData">
-<a class="backward-compatibility-anchor" name="::Sensor::SensorPressureData"></a><h3>2.26. SensorPressureData</h3>
+<a class="backward-compatibility-anchor" name="::Sensor::SensorPressureData"></a><h3>2.28. SensorPressureData</h3>
<div class="brief">
The SensorPressureData interface represents pressure sensor data.
</div>
</div>
</div>
<div class="interface" id="SensorProximityData">
-<a class="backward-compatibility-anchor" name="::Sensor::SensorProximityData"></a><h3>2.27. SensorProximityData</h3>
+<a class="backward-compatibility-anchor" name="::Sensor::SensorProximityData"></a><h3>2.29. SensorProximityData</h3>
<div class="brief">
The SensorProximityData interface represents proximity sensor data.
</div>
</div>
</div>
<div class="interface" id="SensorUltravioletData">
-<a class="backward-compatibility-anchor" name="::Sensor::SensorUltravioletData"></a><h3>2.28. SensorUltravioletData</h3>
+<a class="backward-compatibility-anchor" name="::Sensor::SensorUltravioletData"></a><h3>2.30. SensorUltravioletData</h3>
<div class="brief">
The SensorUltravioletData interface represents ultraviolet sensor data.
</div>
</div>
</div>
<div class="interface" id="SensorHardwareInfo">
-<a class="backward-compatibility-anchor" name="::Sensor::SensorHardwareInfo"></a><h3>2.29. SensorHardwareInfo</h3>
+<a class="backward-compatibility-anchor" name="::Sensor::SensorHardwareInfo"></a><h3>2.31. SensorHardwareInfo</h3>
<div class="brief">
The SensorHardwareInfo interface represents information about the sensor requested by the <a href="sensor.html#Sensor::getSensorHardwareInfo">getSensorHardwareInfo</a> method
</div>
<div class="description">
<ul>
<li>
+ACCELERATION - m/s<sup>2</sup> (meters per second squared) </li>
+ <li>
GRAVITY - m/s<sup>2</sup> (meters per second squared) </li>
<li>
GYROSCOPE - °/s (Degrees/s) </li>
<div class="description">
<ul>
<li>
+ACCELERATION - m/s<sup>2</sup> (meters per second squared) </li>
+ <li>
GRAVITY - m/s<sup>2</sup> (meters per second squared) </li>
<li>
GYROSCOPE - °/s (Degrees/s) </li>
<div class="description">
<ul>
<li>
+ACCELERATION - m/s<sup>2</sup> (meters per second squared) </li>
+ <li>
GRAVITY - m/s<sup>2</sup> (meters per second squared) </li>
<li>
GYROSCOPE - °/s (Degrees/s) </li>
<li>
ULTRAVIOLET - UV index (ultraviolet index) </li>
</ul>
+ <p>
+For more information about sensor, see <a href="https://developer.tizen.org/development/guides/web-application/sensors/device-sensors">Sensor Guide</a>.
+ </p>
</div>
<p><span class="version">
Since: </span>
</div>
</div>
<div class="interface" id="SensorDataSuccessCallback">
-<a class="backward-compatibility-anchor" name="::Sensor::SensorDataSuccessCallback"></a><h3>2.30. SensorDataSuccessCallback</h3>
+<a class="backward-compatibility-anchor" name="::Sensor::SensorDataSuccessCallback"></a><h3>2.32. SensorDataSuccessCallback</h3>
<div class="brief">
The SensorDataSuccessCallback interface is a callback interface that is invoked periodically. For example, see the Sensor interface.
</div>
</div>
</div>
<div class="interface" id="SensorHardwareInfoSuccessCallback">
-<a class="backward-compatibility-anchor" name="::Sensor::SensorHardwareInfoSuccessCallback"></a><h3>2.31. SensorHardwareInfoSuccessCallback</h3>
+<a class="backward-compatibility-anchor" name="::Sensor::SensorHardwareInfoSuccessCallback"></a><h3>2.33. SensorHardwareInfoSuccessCallback</h3>
<div class="brief">
The SensorHardwareInfoSuccessCallback callback interface specifies a success callback with SensorHardwareInfo object as an input argument.
</div>
<div class="def-api-feature">
<p><div class="description">
<p>
+To guarantee that the acceleration sensor application runs on a device with an acceleration sensor, declare the following feature requirements in the config file:
+ </p>
+ </div></p>
+<li class="feature">http://tizen.org/feature/sensor.accelerometer</li>
+</div>
+<div class="def-api-feature">
+<p><div class="description">
+ <p>
To guarantee that the gravity sensor application runs on a device with a gravity sensor, declare the following feature requirements in the config file:
</p>
</div></p>
enum ProximityState { "FAR", "NEAR" };
- enum SensorType { "GRAVITY", "GYROSCOPE", "GYROSCOPE_ROTATION_VECTOR", "GYROSCOPE_UNCALIBRATED", "HRM_RAW", "LIGHT", "LINEAR_ACCELERATION", "MAGNETIC",
+ enum SensorType { "ACCELERATION", "GRAVITY", "GYROSCOPE", "GYROSCOPE_ROTATION_VECTOR", "GYROSCOPE_UNCALIBRATED", "HRM_RAW", "LIGHT", "LINEAR_ACCELERATION", "MAGNETIC",
"MAGNETIC_UNCALIBRATED", "PRESSURE", "PROXIMITY", "ULTRAVIOLET" };
[NoInterfaceObject] interface SensorServiceManagerObject {
void getSensorHardwareInfo(SensorHardwareInfoSuccessCallback successCallback, optional ErrorCallback? errorCallback) raises(WebAPIException);
};
+ [NoInterfaceObject] interface AccelerationSensor : Sensor {
+
+ void getAccelerationSensorData(SensorDataSuccessCallback successCallback,
+ optional ErrorCallback? errorCallback) raises(WebAPIException);
+ };
+
[NoInterfaceObject] interface GravitySensor : Sensor {
void getGravitySensorData(SensorDataSuccessCallback successCallback,
[NoInterfaceObject] interface SensorData {
};
+ [NoInterfaceObject] interface SensorAccelerationData : SensorData {
+
+ readonly attribute double x;
+
+ readonly attribute double y;
+
+ readonly attribute double z;
+ };
+
[NoInterfaceObject] interface SensorGravityData : SensorData {
readonly attribute double x;
</li>
<li>2.3. <a href="#Sensor">Sensor</a>
</li>
-<li>2.4. <a href="#GravitySensor">GravitySensor</a>
+<li>2.4. <a href="#AccelerationSensor">AccelerationSensor</a>
</li>
-<li>2.5. <a href="#GyroscopeSensor">GyroscopeSensor</a>
+<li>2.5. <a href="#GravitySensor">GravitySensor</a>
</li>
-<li>2.6. <a href="#GyroscopeRotationVectorSensor">GyroscopeRotationVectorSensor</a>
+<li>2.6. <a href="#GyroscopeSensor">GyroscopeSensor</a>
</li>
-<li>2.7. <a href="#GyroscopeUncalibratedSensor">GyroscopeUncalibratedSensor</a>
+<li>2.7. <a href="#GyroscopeRotationVectorSensor">GyroscopeRotationVectorSensor</a>
</li>
-<li>2.8. <a href="#HRMRawSensor">HRMRawSensor</a>
+<li>2.8. <a href="#GyroscopeUncalibratedSensor">GyroscopeUncalibratedSensor</a>
</li>
-<li>2.9. <a href="#LightSensor">LightSensor</a>
+<li>2.9. <a href="#HRMRawSensor">HRMRawSensor</a>
</li>
-<li>2.10. <a href="#LinearAccelerationSensor">LinearAccelerationSensor</a>
+<li>2.10. <a href="#LightSensor">LightSensor</a>
</li>
-<li>2.11. <a href="#MagneticSensor">MagneticSensor</a>
+<li>2.11. <a href="#LinearAccelerationSensor">LinearAccelerationSensor</a>
</li>
-<li>2.12. <a href="#MagneticUncalibratedSensor">MagneticUncalibratedSensor</a>
+<li>2.12. <a href="#MagneticSensor">MagneticSensor</a>
</li>
-<li>2.13. <a href="#PressureSensor">PressureSensor</a>
+<li>2.13. <a href="#MagneticUncalibratedSensor">MagneticUncalibratedSensor</a>
</li>
-<li>2.14. <a href="#ProximitySensor">ProximitySensor</a>
+<li>2.14. <a href="#PressureSensor">PressureSensor</a>
</li>
-<li>2.15. <a href="#UltravioletSensor">UltravioletSensor</a>
+<li>2.15. <a href="#ProximitySensor">ProximitySensor</a>
</li>
-<li>2.16. <a href="#SensorData">SensorData</a>
+<li>2.16. <a href="#UltravioletSensor">UltravioletSensor</a>
</li>
-<li>2.17. <a href="#SensorGravityData">SensorGravityData</a>
+<li>2.17. <a href="#SensorData">SensorData</a>
</li>
-<li>2.18. <a href="#SensorGyroscopeData">SensorGyroscopeData</a>
+<li>2.18. <a href="#SensorAccelerationData">SensorAccelerationData</a>
</li>
-<li>2.19. <a href="#SensorGyroscopeRotationVectorData">SensorGyroscopeRotationVectorData</a>
+<li>2.19. <a href="#SensorGravityData">SensorGravityData</a>
</li>
-<li>2.20. <a href="#SensorGyroscopeUncalibratedData">SensorGyroscopeUncalibratedData</a>
+<li>2.20. <a href="#SensorGyroscopeData">SensorGyroscopeData</a>
</li>
-<li>2.21. <a href="#SensorHRMRawData">SensorHRMRawData</a>
+<li>2.21. <a href="#SensorGyroscopeRotationVectorData">SensorGyroscopeRotationVectorData</a>
</li>
-<li>2.22. <a href="#SensorLightData">SensorLightData</a>
+<li>2.22. <a href="#SensorGyroscopeUncalibratedData">SensorGyroscopeUncalibratedData</a>
</li>
-<li>2.23. <a href="#SensorLinearAccelerationData">SensorLinearAccelerationData</a>
+<li>2.23. <a href="#SensorHRMRawData">SensorHRMRawData</a>
</li>
-<li>2.24. <a href="#SensorMagneticData">SensorMagneticData</a>
+<li>2.24. <a href="#SensorLightData">SensorLightData</a>
</li>
-<li>2.25. <a href="#SensorMagneticUncalibratedData">SensorMagneticUncalibratedData</a>
+<li>2.25. <a href="#SensorLinearAccelerationData">SensorLinearAccelerationData</a>
</li>
-<li>2.26. <a href="#SensorPressureData">SensorPressureData</a>
+<li>2.26. <a href="#SensorMagneticData">SensorMagneticData</a>
</li>
-<li>2.27. <a href="#SensorProximityData">SensorProximityData</a>
+<li>2.27. <a href="#SensorMagneticUncalibratedData">SensorMagneticUncalibratedData</a>
</li>
-<li>2.28. <a href="#SensorUltravioletData">SensorUltravioletData</a>
+<li>2.28. <a href="#SensorPressureData">SensorPressureData</a>
</li>
-<li>2.29. <a href="#SensorHardwareInfo">SensorHardwareInfo</a>
+<li>2.29. <a href="#SensorProximityData">SensorProximityData</a>
</li>
-<li>2.30. <a href="#SensorDataSuccessCallback">SensorDataSuccessCallback</a>
+<li>2.30. <a href="#SensorUltravioletData">SensorUltravioletData</a>
</li>
-<li>2.31. <a href="#SensorHardwareInfoSuccessCallback">SensorHardwareInfoSuccessCallback</a>
+<li>2.31. <a href="#SensorHardwareInfo">SensorHardwareInfo</a>
+</li>
+<li>2.32. <a href="#SensorDataSuccessCallback">SensorDataSuccessCallback</a>
+</li>
+<li>2.33. <a href="#SensorHardwareInfoSuccessCallback">SensorHardwareInfoSuccessCallback</a>
</li>
</ul>
</li>
</td>
</tr>
<tr>
+<td><a href="#AccelerationSensor">AccelerationSensor</a></td>
+<td><div>void <a href="#AccelerationSensor::getAccelerationSensorData">getAccelerationSensorData</a> (<a href="#SensorDataSuccessCallback">SensorDataSuccessCallback</a> successCallback, optional <a href="tizen.html#ErrorCallback">ErrorCallback</a>? errorCallback)</div></td>
+</tr>
+<tr>
<td><a href="#GravitySensor">GravitySensor</a></td>
<td><div>void <a href="#GravitySensor::getGravitySensorData">getGravitySensorData</a> (<a href="#SensorDataSuccessCallback">SensorDataSuccessCallback</a> successCallback, optional <a href="tizen.html#ErrorCallback">ErrorCallback</a>? errorCallback)</div></td>
</tr>
<td></td>
</tr>
<tr>
+<td><a href="#SensorAccelerationData">SensorAccelerationData</a></td>
+<td></td>
+</tr>
+<tr>
<td><a href="#SensorGravityData">SensorGravityData</a></td>
<td></td>
</tr>
<div class="brief">
Specifies the sensor type available to the API.
</div>
-<pre class="webidl prettyprint"> enum SensorType { "GRAVITY", "GYROSCOPE", "GYROSCOPE_ROTATION_VECTOR", "GYROSCOPE_UNCALIBRATED", "HRM_RAW", "LIGHT", "LINEAR_ACCELERATION", "MAGNETIC",
+<pre class="webidl prettyprint"> enum SensorType { "ACCELERATION", "GRAVITY", "GYROSCOPE", "GYROSCOPE_ROTATION_VECTOR", "GYROSCOPE_UNCALIBRATED", "HRM_RAW", "LIGHT", "LINEAR_ACCELERATION", "MAGNETIC",
"MAGNETIC_UNCALIBRATED", "PRESSURE", "PROXIMITY", "ULTRAVIOLET" };</pre>
<p><span class="version">
Since: </span>
</p>
<ul>
<li>
+ACCELERATION - Acceleration sensor </li>
+ <li>
GRAVITY - Gravity sensor </li>
<li>
GYROSCOPE - Gyroscope sensor </li>
<em>GRAVITY</em>, <em>GYROSCOPE</em>, <em>GYROSCOPE_ROTATION_VECTOR</em> and <em>LINEAR ACCELERATION</em> are supported since Tizen 3.0
</p>
<p><span class="remark"> Remark : </span>
- <em>GYROSCOPE_UNCALIBRATED</em> and <em>MAGNETIC_UNCALIBRATED</em> are supported since Tizen 4.0
+ <em>ACCELERATION</em>, <em>GYROSCOPE_UNCALIBRATED</em> and <em>MAGNETIC_UNCALIBRATED</em> are supported since Tizen 4.0
</p>
</div>
</div>
</p>
<ul>
<li>
+ ACCELERATION - tizen.systeminfo.getCapability(<em>"http://tizen.org/feature/sensor.accelerometer"</em>) </li>
+ <li>
GRAVITY - tizen.systeminfo.getCapability(<em>"http://tizen.org/feature/sensor.gravity"</em>) </li>
<li>
GYROSCOPE - tizen.systeminfo.getCapability(<em>"http://tizen.org/feature/sensor.gyroscope"</em>) </li>
</dl>
</div>
</div>
+<div class="interface" id="AccelerationSensor">
+<a class="backward-compatibility-anchor" name="::Sensor::AccelerationSensor"></a><h3>2.4. AccelerationSensor</h3>
+<div class="brief">
+ The AccelerationSensor interface provides methods to access accelerometer data.
+ </div>
+<pre class="webidl prettyprint"> [NoInterfaceObject] interface AccelerationSensor : <a href="#Sensor">Sensor</a> {
+
+ void getAccelerationSensorData(<a href="#SensorDataSuccessCallback">SensorDataSuccessCallback</a> successCallback,
+ optional <a href="tizen.html#ErrorCallback">ErrorCallback</a>? errorCallback) raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
+ };</pre>
+<p><span class="version">
+ Since: </span>
+ 4.0
+ </p>
+
+ <div class="methods">
+<h4>Methods</h4>
+<dl>
+<dt class="method" id="AccelerationSensor::getAccelerationSensorData">
+<a class="backward-compatibility-anchor" name="::Sensor::AccelerationSensor::getAccelerationSensorData"></a><code><b><span class="methodName">getAccelerationSensorData</span></b></code>
+</dt>
+<dd>
+<div class="brief">
+ Gets the current acceleration sensor data. You can refer to <a href="sensor.html#SensorAccelerationData">SensorAccelerationData</a> interface.
+ </div>
+<div class="synopsis"><pre class="signature prettyprint">void getAccelerationSensorData(<a href="#SensorDataSuccessCallback">SensorDataSuccessCallback</a> successCallback, optional <a href="tizen.html#ErrorCallback">ErrorCallback</a>? errorCallback);
+ </pre></div>
+<p><span class="version">
+ Since: </span>
+ 4.0
+ </p>
+<div class="description">
+ <p>
+Note that before calling the getAccelerationSensorData() method, the start() method should be called to turn the sensor on.
+ </p>
+ <p>
+The <em>ErrorCallback</em> method is launched with these error types:
+ </p>
+ <ul>
+ <li>
+ ServiceNotAvailableError : If the <em>getAccelerationSensorData()</em> method is called without first calling the <em>start()</em> method </li>
+ <li>
+ AbortError : If the system operation was aborted </li>
+ </ul>
+ </div>
+<div class="parameters">
+<p><span class="param">Parameters:</span></p>
+<ul>
+ <li class="param">
+<span class="name">successCallback</span>:
+ Callback method to be invoked when the sensor data has been read
+ </li>
+ <li class="param">
+<span class="name">errorCallback</span><span class="optional"> [optional]</span><span class="optional"> [nullable]</span>:
+ Callback method to be invoked when an error occurs
+ </li>
+ </ul>
+</div>
+<div class="exceptionlist">
+<p><span class="except">Exceptions:</span></p>
+ <ul class="exception"><li>WebAPIException<ul><li class="list"><p>
+ with error type TypeMismatchError, if any input parameter is not compatible with the expected type for that parameter.
+ </p></li></ul>
+</li></ul>
+ </div>
+<div class="example">
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> var accelerationSensor = tizen.sensorservice.getDefaultSensor("ACCELERATION");
+
+ function onGetSuccessCB(sensorData)
+ {
+ console.log("######## Get acceleration sensor data ########");
+ console.log("x: " + sensorData.x);
+ console.log("y: " + sensorData.y);
+ console.log("z: " + sensorData.z);
+ }
+
+ function onerrorCB(error)
+ {
+ console.log("error occurred: " + error.message);
+ }
+
+ function onsuccessCB()
+ {
+ console.log("acceleration sensor start");
+ accelerationSensor.getAccelerationSensorData(onGetSuccessCB, onerrorCB);
+ }
+
+ accelerationSensor.start(onsuccessCB);
+ </pre>
+</div>
+<div class="output">
+<span class="title"><p>Output example:</p></span><pre> acceleration sensor start
+ ######## Get acceleration sensor data ########
+ x: -4.311866283416748
+ y: 8.6243314743042
+ z: 2.841476917266846
+ </pre>
+</div>
+</dd>
+</dl>
+</div>
+</div>
<div class="interface" id="GravitySensor">
-<a class="backward-compatibility-anchor" name="::Sensor::GravitySensor"></a><h3>2.4. GravitySensor</h3>
+<a class="backward-compatibility-anchor" name="::Sensor::GravitySensor"></a><h3>2.5. GravitySensor</h3>
<div class="brief">
The GravitySensor interface provides methods to access gravity sensor data.
</div>
</div>
</div>
<div class="interface" id="GyroscopeSensor">
-<a class="backward-compatibility-anchor" name="::Sensor::GyroscopeSensor"></a><h3>2.5. GyroscopeSensor</h3>
+<a class="backward-compatibility-anchor" name="::Sensor::GyroscopeSensor"></a><h3>2.6. GyroscopeSensor</h3>
<div class="brief">
The GyroscopeSensor interface provides methods to access gyroscope sensor data.
</div>
</div>
</div>
<div class="interface" id="GyroscopeRotationVectorSensor">
-<a class="backward-compatibility-anchor" name="::Sensor::GyroscopeRotationVectorSensor"></a><h3>2.6. GyroscopeRotationVectorSensor</h3>
+<a class="backward-compatibility-anchor" name="::Sensor::GyroscopeRotationVectorSensor"></a><h3>2.7. GyroscopeRotationVectorSensor</h3>
<div class="brief">
The GyroscopeRotationVectorSensor interface provides methods to access gyroscope rotation vector sensor data.
</div>
</div>
</div>
<div class="interface" id="GyroscopeUncalibratedSensor">
-<a class="backward-compatibility-anchor" name="::Sensor::GyroscopeUncalibratedSensor"></a><h3>2.7. GyroscopeUncalibratedSensor</h3>
+<a class="backward-compatibility-anchor" name="::Sensor::GyroscopeUncalibratedSensor"></a><h3>2.8. GyroscopeUncalibratedSensor</h3>
<div class="brief">
The GyroscopeUncalibratedSensor interface provides methods to access uncalibrated gyroscope sensor data.
</div>
</div>
</div>
<div class="interface" id="HRMRawSensor">
-<a class="backward-compatibility-anchor" name="::Sensor::HRMRawSensor"></a><h3>2.8. HRMRawSensor</h3>
+<a class="backward-compatibility-anchor" name="::Sensor::HRMRawSensor"></a><h3>2.9. HRMRawSensor</h3>
<div class="brief">
The HRMRawSensor interface provides methods to access HRM sensor raw data.
</div>
</div>
</div>
<div class="interface" id="LightSensor">
-<a class="backward-compatibility-anchor" name="::Sensor::LightSensor"></a><h3>2.9. LightSensor</h3>
+<a class="backward-compatibility-anchor" name="::Sensor::LightSensor"></a><h3>2.10. LightSensor</h3>
<div class="brief">
The LightSensor interface provides methods to access light sensor data.
</div>
</div>
</div>
<div class="interface" id="LinearAccelerationSensor">
-<a class="backward-compatibility-anchor" name="::Sensor::LinearAccelerationSensor"></a><h3>2.10. LinearAccelerationSensor</h3>
+<a class="backward-compatibility-anchor" name="::Sensor::LinearAccelerationSensor"></a><h3>2.11. LinearAccelerationSensor</h3>
<div class="brief">
The LinearAccelerationSensor interface provides methods to access linear acceleration sensor data.
</div>
</div>
</div>
<div class="interface" id="MagneticSensor">
-<a class="backward-compatibility-anchor" name="::Sensor::MagneticSensor"></a><h3>2.11. MagneticSensor</h3>
+<a class="backward-compatibility-anchor" name="::Sensor::MagneticSensor"></a><h3>2.12. MagneticSensor</h3>
<div class="brief">
The MagneticSensor interface provides methods to access magnetic sensor data.
</div>
</div>
</div>
<div class="interface" id="MagneticUncalibratedSensor">
-<a class="backward-compatibility-anchor" name="::Sensor::MagneticUncalibratedSensor"></a><h3>2.12. MagneticUncalibratedSensor</h3>
+<a class="backward-compatibility-anchor" name="::Sensor::MagneticUncalibratedSensor"></a><h3>2.13. MagneticUncalibratedSensor</h3>
<div class="brief">
The MagneticUncalibratedSensor interface provides methods to access uncalibrated magnetic sensor data.
</div>
</div>
</div>
<div class="interface" id="PressureSensor">
-<a class="backward-compatibility-anchor" name="::Sensor::PressureSensor"></a><h3>2.13. PressureSensor</h3>
+<a class="backward-compatibility-anchor" name="::Sensor::PressureSensor"></a><h3>2.14. PressureSensor</h3>
<div class="brief">
The PressureSensor interface provides methods to access pressure sensor data.
</div>
</div>
</div>
<div class="interface" id="ProximitySensor">
-<a class="backward-compatibility-anchor" name="::Sensor::ProximitySensor"></a><h3>2.14. ProximitySensor</h3>
+<a class="backward-compatibility-anchor" name="::Sensor::ProximitySensor"></a><h3>2.15. ProximitySensor</h3>
<div class="brief">
The ProximitySensor interface provides methods to access proximity sensor data.
</div>
</div>
</div>
<div class="interface" id="UltravioletSensor">
-<a class="backward-compatibility-anchor" name="::Sensor::UltravioletSensor"></a><h3>2.15. UltravioletSensor</h3>
+<a class="backward-compatibility-anchor" name="::Sensor::UltravioletSensor"></a><h3>2.16. UltravioletSensor</h3>
<div class="brief">
The UltravioletSensor interface provides methods to access ultraviolet sensor data.
</div>
</div>
</div>
<div class="interface" id="SensorData">
-<a class="backward-compatibility-anchor" name="::Sensor::SensorData"></a><h3>2.16. SensorData</h3>
+<a class="backward-compatibility-anchor" name="::Sensor::SensorData"></a><h3>2.17. SensorData</h3>
<div class="brief">
The SensorData interface is a common abstract interface used by different types of sensor data objects.
</div>
2.3
</p>
</div>
+<div class="interface" id="SensorAccelerationData">
+<a class="backward-compatibility-anchor" name="::Sensor::SensorAccelerationData"></a><h3>2.18. SensorAccelerationData</h3>
+<div class="brief">
+ The SensorAccelerationData interface represents acceleration sensor data. You can refer to <a href="https://developer.tizen.org/development/guides/native-application/system/sensor#accelerometer">this guide</a> to learn more about acceleration sensor data.
+ </div>
+<pre class="webidl prettyprint"> [NoInterfaceObject] interface SensorAccelerationData : <a href="#SensorData">SensorData</a> {
+
+ readonly attribute double x;
+
+ readonly attribute double y;
+
+ readonly attribute double z;
+ };</pre>
+<p><span class="version">
+ Since: </span>
+ 4.0
+ </p>
+<div class="description">
+ <p>
+The acceleration sensor data represents the sum of acceleration of the device and an acceleration component representing forces opposing the gravity.
+ </p>
+ </div>
+<p><span class="remark"> Remark : </span>
+ An example of how to access and use this interface can be found in the <a href="sensor.html#AccelerationSensor::getAccelerationSensorData">getAccelerationSensorData()</a> code example.
+ </p>
+
+ <div class="attributes">
+<h4>Attributes</h4>
+<ul>
+<li class="attribute" id="SensorAccelerationData::x">
+<span class="attrName"><span class="readonly"> readonly
+</span><span class="type">double </span><span class="name">x</span></span><div class="brief">
+ The result of acceleration sensor measurement in the device's X axis in m/s².<br>The value can be between -19.6 and 19.6 inclusive.
+ </div>
+<p><span class="version">
+ Since: </span>
+ 4.0
+ </p>
+</li>
+<li class="attribute" id="SensorAccelerationData::y">
+<span class="attrName"><span class="readonly"> readonly
+</span><span class="type">double </span><span class="name">y</span></span><div class="brief">
+ The result of acceleration sensor measurement in the device's Y axis in m/s².<br>The value can be between -19.6 and 19.6 inclusive.
+ </div>
+<p><span class="version">
+ Since: </span>
+ 4.0
+ </p>
+</li>
+<li class="attribute" id="SensorAccelerationData::z">
+<span class="attrName"><span class="readonly"> readonly
+</span><span class="type">double </span><span class="name">z</span></span><div class="brief">
+ The result of acceleration sensor measurement in the device's Z axis in m/s².<br>The value can be between -19.6 and 19.6 inclusive.
+ </div>
+<p><span class="version">
+ Since: </span>
+ 4.0
+ </p>
+</li>
+</ul>
+</div>
+</div>
<div class="interface" id="SensorGravityData">
-<a class="backward-compatibility-anchor" name="::Sensor::SensorGravityData"></a><h3>2.17. SensorGravityData</h3>
+<a class="backward-compatibility-anchor" name="::Sensor::SensorGravityData"></a><h3>2.19. SensorGravityData</h3>
<div class="brief">
The SensorGravityData interface represents gravity sensor data. You can refer to <a href="https://developer.tizen.org/development/guides/native-application/system/sensor#gravity">this guide</a> to learn more about gravity sensor data.
</div>
</div>
</div>
<div class="interface" id="SensorGyroscopeData">
-<a class="backward-compatibility-anchor" name="::Sensor::SensorGyroscopeData"></a><h3>2.18. SensorGyroscopeData</h3>
+<a class="backward-compatibility-anchor" name="::Sensor::SensorGyroscopeData"></a><h3>2.20. SensorGyroscopeData</h3>
<div class="brief">
The SensorGyroscopeData interface represents gyroscope sensor data. You can refer to <a href="https://developer.tizen.org/development/guides/native-application/system/sensor#gyro">this guide</a> to learn more about gyroscope sensor data.
</div>
</div>
</div>
<div class="interface" id="SensorGyroscopeRotationVectorData">
-<a class="backward-compatibility-anchor" name="::Sensor::SensorGyroscopeRotationVectorData"></a><h3>2.19. SensorGyroscopeRotationVectorData</h3>
+<a class="backward-compatibility-anchor" name="::Sensor::SensorGyroscopeRotationVectorData"></a><h3>2.21. SensorGyroscopeRotationVectorData</h3>
<div class="brief">
The SensorGyroscopeRotationVectorData interface represents gyroscope rotation vector sensor data. You can refer to <a href="https://developer.tizen.org/development/guides/native-application/system/sensor#gyro_rotation">this guide</a> to learn more about gyroscope sensor data.
</div>
</div>
</div>
<div class="interface" id="SensorGyroscopeUncalibratedData">
-<a class="backward-compatibility-anchor" name="::Sensor::SensorGyroscopeUncalibratedData"></a><h3>2.20. SensorGyroscopeUncalibratedData</h3>
+<a class="backward-compatibility-anchor" name="::Sensor::SensorGyroscopeUncalibratedData"></a><h3>2.22. SensorGyroscopeUncalibratedData</h3>
<div class="brief">
The SensorGyroscopeUncalibratedData interface represents uncalibrated gyroscope sensor data.
</div>
</div>
</div>
<div class="interface" id="SensorHRMRawData">
-<a class="backward-compatibility-anchor" name="::Sensor::SensorHRMRawData"></a><h3>2.21. SensorHRMRawData</h3>
+<a class="backward-compatibility-anchor" name="::Sensor::SensorHRMRawData"></a><h3>2.23. SensorHRMRawData</h3>
<div class="brief">
The SensorHRMRawData interface represents HRM sensor raw data.
</div>
</div>
</div>
<div class="interface" id="SensorLightData">
-<a class="backward-compatibility-anchor" name="::Sensor::SensorLightData"></a><h3>2.22. SensorLightData</h3>
+<a class="backward-compatibility-anchor" name="::Sensor::SensorLightData"></a><h3>2.24. SensorLightData</h3>
<div class="brief">
The SensorLightData interface represents light sensor data.
</div>
</div>
</div>
<div class="interface" id="SensorLinearAccelerationData">
-<a class="backward-compatibility-anchor" name="::Sensor::SensorLinearAccelerationData"></a><h3>2.23. SensorLinearAccelerationData</h3>
+<a class="backward-compatibility-anchor" name="::Sensor::SensorLinearAccelerationData"></a><h3>2.25. SensorLinearAccelerationData</h3>
<div class="brief">
The SensorLinearAccelerationData interface represents linear acceleration sensor data.
</div>
</div>
</div>
<div class="interface" id="SensorMagneticData">
-<a class="backward-compatibility-anchor" name="::Sensor::SensorMagneticData"></a><h3>2.24. SensorMagneticData</h3>
+<a class="backward-compatibility-anchor" name="::Sensor::SensorMagneticData"></a><h3>2.26. SensorMagneticData</h3>
<div class="brief">
The SensorMagneticData interface represents magnetic sensor data.
</div>
</div>
</div>
<div class="interface" id="SensorMagneticUncalibratedData">
-<a class="backward-compatibility-anchor" name="::Sensor::SensorMagneticUncalibratedData"></a><h3>2.25. SensorMagneticUncalibratedData</h3>
+<a class="backward-compatibility-anchor" name="::Sensor::SensorMagneticUncalibratedData"></a><h3>2.27. SensorMagneticUncalibratedData</h3>
<div class="brief">
The SensorMagneticUncalibratedData interface represents uncalibrated magnetic sensor data.
</div>
</div>
</div>
<div class="interface" id="SensorPressureData">
-<a class="backward-compatibility-anchor" name="::Sensor::SensorPressureData"></a><h3>2.26. SensorPressureData</h3>
+<a class="backward-compatibility-anchor" name="::Sensor::SensorPressureData"></a><h3>2.28. SensorPressureData</h3>
<div class="brief">
The SensorPressureData interface represents pressure sensor data.
</div>
</div>
</div>
<div class="interface" id="SensorProximityData">
-<a class="backward-compatibility-anchor" name="::Sensor::SensorProximityData"></a><h3>2.27. SensorProximityData</h3>
+<a class="backward-compatibility-anchor" name="::Sensor::SensorProximityData"></a><h3>2.29. SensorProximityData</h3>
<div class="brief">
The SensorProximityData interface represents proximity sensor data.
</div>
</div>
</div>
<div class="interface" id="SensorUltravioletData">
-<a class="backward-compatibility-anchor" name="::Sensor::SensorUltravioletData"></a><h3>2.28. SensorUltravioletData</h3>
+<a class="backward-compatibility-anchor" name="::Sensor::SensorUltravioletData"></a><h3>2.30. SensorUltravioletData</h3>
<div class="brief">
The SensorUltravioletData interface represents ultraviolet sensor data.
</div>
</div>
</div>
<div class="interface" id="SensorHardwareInfo">
-<a class="backward-compatibility-anchor" name="::Sensor::SensorHardwareInfo"></a><h3>2.29. SensorHardwareInfo</h3>
+<a class="backward-compatibility-anchor" name="::Sensor::SensorHardwareInfo"></a><h3>2.31. SensorHardwareInfo</h3>
<div class="brief">
The SensorHardwareInfo interface represents information about the sensor requested by the <a href="sensor.html#Sensor::getSensorHardwareInfo">getSensorHardwareInfo</a> method
</div>
<div class="description">
<ul>
<li>
+ACCELERATION - m/s<sup>2</sup> (meters per second squared) </li>
+ <li>
GRAVITY - m/s<sup>2</sup> (meters per second squared) </li>
<li>
GYROSCOPE - °/s (Degrees/s) </li>
<div class="description">
<ul>
<li>
+ACCELERATION - m/s<sup>2</sup> (meters per second squared) </li>
+ <li>
GRAVITY - m/s<sup>2</sup> (meters per second squared) </li>
<li>
GYROSCOPE - °/s (Degrees/s) </li>
<div class="description">
<ul>
<li>
+ACCELERATION - m/s<sup>2</sup> (meters per second squared) </li>
+ <li>
GRAVITY - m/s<sup>2</sup> (meters per second squared) </li>
<li>
GYROSCOPE - °/s (Degrees/s) </li>
<li>
ULTRAVIOLET - UV index (ultraviolet index) </li>
</ul>
+ <p>
+For more information about sensor, see <a href="https://developer.tizen.org/development/guides/web-application/sensors/device-sensors">Sensor Guide</a>.
+ </p>
</div>
<p><span class="version">
Since: </span>
</div>
</div>
<div class="interface" id="SensorDataSuccessCallback">
-<a class="backward-compatibility-anchor" name="::Sensor::SensorDataSuccessCallback"></a><h3>2.30. SensorDataSuccessCallback</h3>
+<a class="backward-compatibility-anchor" name="::Sensor::SensorDataSuccessCallback"></a><h3>2.32. SensorDataSuccessCallback</h3>
<div class="brief">
The SensorDataSuccessCallback interface is a callback interface that is invoked periodically. For example, see the Sensor interface.
</div>
</div>
</div>
<div class="interface" id="SensorHardwareInfoSuccessCallback">
-<a class="backward-compatibility-anchor" name="::Sensor::SensorHardwareInfoSuccessCallback"></a><h3>2.31. SensorHardwareInfoSuccessCallback</h3>
+<a class="backward-compatibility-anchor" name="::Sensor::SensorHardwareInfoSuccessCallback"></a><h3>2.33. SensorHardwareInfoSuccessCallback</h3>
<div class="brief">
The SensorHardwareInfoSuccessCallback callback interface specifies a success callback with SensorHardwareInfo object as an input argument.
</div>
<div class="def-api-feature">
<p><div class="description">
<p>
+To guarantee that the acceleration sensor application runs on a device with an acceleration sensor, declare the following feature requirements in the config file:
+ </p>
+ </div></p>
+<li class="feature">http://tizen.org/feature/sensor.accelerometer</li>
+</div>
+<div class="def-api-feature">
+<p><div class="description">
+ <p>
To guarantee that the gravity sensor application runs on a device with a gravity sensor, declare the following feature requirements in the config file:
</p>
</div></p>
enum ProximityState { "FAR", "NEAR" };
- enum SensorType { "GRAVITY", "GYROSCOPE", "GYROSCOPE_ROTATION_VECTOR", "GYROSCOPE_UNCALIBRATED", "HRM_RAW", "LIGHT", "LINEAR_ACCELERATION", "MAGNETIC",
+ enum SensorType { "ACCELERATION", "GRAVITY", "GYROSCOPE", "GYROSCOPE_ROTATION_VECTOR", "GYROSCOPE_UNCALIBRATED", "HRM_RAW", "LIGHT", "LINEAR_ACCELERATION", "MAGNETIC",
"MAGNETIC_UNCALIBRATED", "PRESSURE", "PROXIMITY", "ULTRAVIOLET" };
[NoInterfaceObject] interface SensorServiceManagerObject {
void getSensorHardwareInfo(SensorHardwareInfoSuccessCallback successCallback, optional ErrorCallback? errorCallback) raises(WebAPIException);
};
+ [NoInterfaceObject] interface AccelerationSensor : Sensor {
+
+ void getAccelerationSensorData(SensorDataSuccessCallback successCallback,
+ optional ErrorCallback? errorCallback) raises(WebAPIException);
+ };
+
[NoInterfaceObject] interface GravitySensor : Sensor {
void getGravitySensorData(SensorDataSuccessCallback successCallback,
[NoInterfaceObject] interface SensorData {
};
+ [NoInterfaceObject] interface SensorAccelerationData : SensorData {
+
+ readonly attribute double x;
+
+ readonly attribute double y;
+
+ readonly attribute double z;
+ };
+
[NoInterfaceObject] interface SensorGravityData : SensorData {
readonly attribute double x;