Tizen Wearable 3.0 unable to read accelerometer sensor from the device

Tizen Wearable 3.0 unable to read accelerometer sensor from the device

BY 10 Apr 2018 Web Application Development

Hello.

I’m trying to get accelerometer data from my Samsung Gear Sport. I’m following this API reference https://developer.tizen.org/ko/development/api-references/web-application?redirect=/dev-guide/latest/org.tizen.web.apireference/html/device_api/wearable/tizen/sensor.html&langredirect=1#AccelerationSensor::getAccelerationSensorData

 

here is my code:

 

 if (tizen.systeminfo.getCapability(“http://tizen.org/feature/sensor.accelerometer”) == true) {

            console.log(“acceleration is supported in this device”);

            var accelerationSensor = tizen.sensorservice.getDefaultSensor(“ACCELERATION”);

else {

            console.log(“acceleration is not supported in this device”);

}

 

and my logs say:

 

accelerometer is supported on this device.
VM45:1 Uncaught TypeMismatchError: Cannot convert ACCELERATION to enum.

 

I’ve also tried with “ACCELEROMETER” and “LINEAR_ACCELERATION” and “SENSOR_ACCELEROMETER”. None worked.

Also I’ve tried with ‘GYROSCOPE’ and it works OK…

What is the problem?

Written by