Languages

Menu
Sites
Language
Sensorservice in tizen wearable web api is not working when display is off

Hi

I'm developing app sensing acceleration, gyro, magnet, UV, light, pressure and HRM in gear S.

Recently, I found that sensor api is not working when display is off

When I called sensorservice.getDefaultSensor, it worked well though display is off

But when I called getSensorData (ex: getLightSensor) at off-display, Unknown error is occurred

And sensorChangeListener is not called when display is off

It happened to sensor api only, HRM or devicemotion(acceleration and gyro) is not

How can I solve this problem without always-on-display?

Responses

4 Replies
Nafisul Islam Kiron

Hello,  try turning on the background mode, you can find it here:

YOUR PROJECT > config.xml > Tizen > background-support > enable

 

Also add this line in you code:

tizen.power.request("CPU", "CPU_AWAKE");

Hyunjun Kim

I tried that already, but it didn't work

 

I think this problem is bug or intention

Sangil Im

안녕하세요 기어 S3 센서데이터 (조도, 기압등 )를 수집하는 앱을 만들고 있는데 저도 마찬가지로 화면이 꺼지면 데이터를 가져올 수 없더라구요 혹시 이문제를 해결하셨나요?? 지나가다가 질문 남깁니다.

K Johnson
Hello Sangil Im, Would you please try with Managing Power Resources section in the link below: https://developer.tizen.org/development/guides/web-application/device-settings-and-systems/power-states#manage