语言

Menu
Sites
Language
How to prevent go my app OnSleep / OR / How to keep sensors active when OnSleep?

Hello,

I am solving my biggest problem. I create app that measure heart beat from tizen.sensor. You can set the range, for example from 50 - 120 and if your BPM is below or above this range - display alert (and other functions) appear.  This works perfectly, when you look at this app and it is active on screen. Problem started, when you dont look on watch and they go "sleep" (black screen). Sensors are down in this state. So I cant measure.

Question is - is there any option to block app going to sleep? OR is there any option to keep sensors alive? I am googling all day this problem and still dont find any simply solution for this.

Additional question - If we figure it out, how to keep sensors alive (app still goes on background) - is it possible, that if BPM is over / below my setted range - this function can open my app so user see it?

 

查看选择的答案

响应

1 回复
Mark as answer
Tizen .NET

Hi,
Please check Power.RequestLock(PowerLock.Cpu, 0)/ReleaseLock(PowerLock.Cpu) APIs which are available on Tizen 5.0 and above.
(To use Power API, http://tizen.org/privilege/display privilege should be defined in tizen-manifest.xml file.)
If you want to send your app in the background to the foreground when certain conditions are met, you can do it with AppControl API.