Languages

Menu
Sites
Language
access STRESS_MONITOR data from the Galaxy watch.

Hello,

Is there any way to access the STRESS_MONITOR data from the galaxy watch ? Similar to the Samsung health APP on Android

. Thank you.

Responses

9 Replies
André Reus

Hi, You can use Human Activity Monitor to get the Stress data 

https://developer.tizen.org/ko/development/guides/web-application/sensors/human-activity-monitor?langredirect=1#monitoring-stress

 

function onchangedCB(info)
{
    console.log("score: " + info.stressScore);
}

function onerrorCB(error)
{
    console.log("Error occurred, name: " + error.name + ", message: " + error.message);
}

try
{
    tizen.humanactivitymonitor.start("STRESS_MONITOR", onchangedCB, onerrorCB,
                                     {callbackInterval: 1500, sampleInterval: 100});
}
catch (err)
{
    console.log(err.name + ": " + err.message);
}

 

sha kuni

Hi Andre,

Thank you for your reply, I tried this but I'm getting the following error.

" Uncaught TypeMismatchError: Cannot convert STRESS_MONITOR to enum."

Any ideas?

 

 

André Reus

May be need to get the permission on runtime follow  the guide provided on previous comment and this https://developer.tizen.org/forums/web-application-development/security-exception-while-accessing-hrm

sha kuni

Hi,

The runtine permissions were in place. Note the exception thrown is not security related.

"Uncaught TypeMismatchError: Cannot convert STRESS_MONITOR to enum." Is the stress_monitor data accessible on the Galaxy watch?

Thank you,

 

André Reus

Hi, have you tried by calling addStressMonitorChangeListener() ?

tizen.humanactivitymonitor.addStressMonitorChangeListener
sha kuni

Hi Andre,

Thank you for your reply, but it still doesn't work. Here is my code.

https://ghostbin.com/paste/7xbfg

I get the following errors

https://ghostbin.com/paste/98pz7.

 

 

André Reus

hi, please post you code and error here....i can't access the urls

Marco Buettner

Did u see on the documentation this part?

Remark: SLEEP_DETECTOR and STRESS_MONITOR are supported since Tizen 5.0

You need required_version on config.xml of Tizen 5.0 to use STRESS_MONITOR

sha kuni

Yes, thank you! But, the Samsung Health App in Android is able to retrieve the stress information from the watch.

I was looking for the API's to get the same information as the Samsung Health App does.

Any pointers appreciated.