Languages

Menu
Sites
Language
How to get a current Heart Rate count without scanning, just to show this information in a Watch Face?

Could you help me? I'm looking for a way how to show a current Heart Rate count without scanning in a Watch Face (Gear S3, Tizen 2.3.2). I've already found the way below, but it isn't suitable because it makes scanning.

 

window.webapis.motion.start("HRM", onchangedCB(hrmInfo){
    if(hrmInfo.heartRate > 0) {
        heartRateEl.innerHTML = hrmInfo.heartRate + "bpm";
    } else {
        heartRateEl.innerHTML = "No heart rate detected.";
    }
});
webapis.motion.stop("HRM");

 

Is it possible to get a count from S Health that measures Heart Rate itself periodically?

For example the native Watch Face 'Gear Dashboard' shows actual Heart Rate count.

Thanks!

Edited by: Anonymous on 03 May, 2019

Responses

2 Replies
Armaan-Ul- Islam

p { margin-bottom: 0.1in; line-height: 120%; }a:link { } To measure heart rate Wearable device has to power on the IR LED/LED_GREEN on back off the watch. You cannot get a real time reading without scanning (takes some seconds), if you have a reading without scanning it may indicate a previously measured data.

 

One thing is possible that you launch the heart rate monitor without interaction from user (such as: tap button), but scanning would be required for concurrent data.

 

S health data is a property of S health application. I guess you won't be able to fetch data from their app unless they are providing so. You may try launching heart rate measure function at specific time or time interval using Tizen HRM. I am sharing a code sample here:

 

function measureCB(hrmInfo) {

    console.log("Heart Rate: " + hrmInfo.heartRate);

    console.log("Peak-to-peak interval: " + hrmInfo.rRInterval + " milliseconds");


    tizen.humanactivitymonitor.stop("HRM");
}


function launch(){

    tizen.humanactivitymonitor.start("HRM", measureCB);

    setTimeout("launch()",5000000); // run launch() again after 5000000 ms
}

launch();

 

 

If you are interested in storing the data you may use Javascrpit var or Tizen FileSystem or Web Storage.

 

Thank you a lot for your reply!

However native Samsung watch faces have access to an actual Heart Rate count somehow. Also GearWatchDesigner allows to add such counts.

There is must be another way to get these counts. Probably methods Samsung uses are in a secret.