Cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Real-time heart rate in native Android/iOS app

ANSWERED

Hello, I'm working on a native Android/iOS app that will require real time heart rate data from smart watches. I already have a Fitbit so I figured it'd be a good place to start.

 

Am I correct that accessing the heart rate monitor directly from the mobile OS is not doable, and that I will need to have a FitbitOS app running in the foreground on the watch, accessing the heart rate monitor via the device API, and sending the data to the Fitbit phone app via the messaging API, which then can send the data to a server running on the phone?

Best Answer
0 Votes
1 BEST ANSWER

Accepted Solutions

That's 98% right. It's possible to use File Transfer instead of messaging (there are pros and cons), and the server doesn't need to run on the phone (it can run anywhere but must have non-self-signed security).

Peter McLennan
Gondwana Software

View best answer in original post

Best Answer
0 Votes
5 REPLIES 5

That's 98% right. It's possible to use File Transfer instead of messaging (there are pros and cons), and the server doesn't need to run on the phone (it can run anywhere but must have non-self-signed security).

Peter McLennan
Gondwana Software
Best Answer
0 Votes

Can I get the current heart rate from the watch and display it in the android app(written by me) without a server?

Best Answer
0 Votes

The most direct route would be for the android app (written by you) to be a server; ie, able to receive a fetch() or websocket request. Those are the only ways to get real-time data out of the device.

Peter McLennan
Gondwana Software
Best Answer

Does the watch connect to the phone and share the same network with the phone ip? And can I use http://localhost:port to do the websocket and connect with the phone app directly? 

Best Answer
0 Votes

You never actually get to communicate directly with the watch. The watch communicates with the companion, which runs within the Fitbit app on the phone.

I don't think 'localhost' will work, but there are some equivalents that may work for you. Obviously this presupposes that your Android app/server is running on your phone (as is the Fitbit app), so 'same network' doesn't apply.

Also, this might help.

Peter McLennan
Gondwana Software
Best Answer