语言

Menu
Sites
Language
How to continuously record sensor's data into filesystem while Gear S is in idle mode.

Hi, 
I have developed a small utility app on Samsung Gear S which intented to record data from multiple sensors (such as Heart Rate & Pedometer) on device into local file system.
Every second it collect the data and write as a row entry into a plain text file under the path /opt/usr/media/Documents. It works while the gear S display is on, but the recording job will be suspended while the Gear S is in idle mode and the display has been turned off. It will resume the recording while the display is on again.

Can anyone has some idea about how to keep the app running and continuously write into file while the gear S is in idle mode?

PS. I've already try to set the background mode on in config.xml, the app will still suspend after 3-5mins.

tizen:setting background-support="enabled"

 

查看选择的答案

响应

3 回复
Mark as answer
AVSukhov

Hello,

You can try to use Power API.

Using Power API you can request CPU_AWAKE state. When this state is requested, the device does not go to SLEEP state automatically.

But you need understand that using this state may result in fast discharge the battery.

Derek Kuo

Thanks it perfectly solved the problem.

colin Rao

I am not familiar the Gear S, I just thinking is it possible to make is as a service which will running in background.