[Web applicaiton]Get Hrm data from Gear S3

[Web applicaiton]Get Hrm data from Gear S3

BY 07 Aug 2018 Web Application Development

Good day developers.


I’m trying to Hrm detecting Web application for this vacation.

It’s based on open source from Samsung HelloAccesary and HeartRateMonitor sample.

My purpose is detecting Heartreate, also it passes data to my Phone.

So, Phone(OS is Android)’s apk will compare rate, if the data over ‘120’, then it make events.

But problem is apk can’t distinguish the Rate. It always distinguish ‘message’ is bigger than ‘heart_attack_rate’.

However, the value is low.

 

If you can help me, please give som advice 

Thnak you.

ps. at the below, there’s code.

 

public int cmp_number(String num1, String num2)

 

{ int store_num = num1.compareTo(num2); return store_num;} //Function, which compare two String values

 

 

// 180806 public void onReceive(int channelId, byte[] data)

{ final String message = new String(data);

String heart_attack_rate="120"; //heart attack rate

int cmnumber=cmp_number(heart_attack_rate,message); //compare to values

if (cmnumber<0)

{ addMessage("Detected Hrm Rate: ", message);

addMessage("Detected number: ", Integer.toString(cmnumber)); }//normal state

else

{ updateTextView("Heart attack!!");

addMessage("Heart attack happened: ", message);

addMessage("Detected number: ", Integer.toString(cmnumber));// for looking compareto() value

} }//heart attak happen

Written by