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

Storing time, hr, and gps information from fitbit device?

ANSWERED

Hi,

 

I am a graduate student and I want to write an app that stores time, gps, and heart rate data from the phone. I would like to take a walk and record this information. I think of it like a timer application. I click start and I store my time, gps, and heart rate data on the phone. My question is simple. Is there a technical way to write an app on the fitbit that can store this data on an Android phone? Conversely, is there a way to write an android app that can obtain this information (via a library of some sort) from the fitbit? For example, I think this is possible for Xamarin and iOS (see here).

 

If none of these approaches are possible, is there any way I can record a route I walk with the data I need? In other words, is there a way that I can store data I record from a route and obtain it later in csv format from a web api or something? That is, record a route/session and then obtain all the time, gps, and heart rate data as needed. I doubt I will record a lot of sessions, but I would like to make it extensible in theory from 1 to N routes/sessions.

 

Thanks,
hlyates

Best Answer
0 Votes
1 BEST ANSWER

Accepted Solutions

Your options are:

 

(1) Download activity data from the web API. This option only requires minimal programming.

(2) Write a FitBit app that collects activity data from the device and transfers it to the companion, which then uploads it to your server. The native phone app then downloads it from the server.

(3) Write a FitBit app that collects its own data for your own activity sessions and then transfers it to the companion for upload, as in (2).

 

Options (2) and (3) take serious thought about security, unless you're only copying your own data (and you don't care about its security). In order to upload to a server or download from it, you have to use an end point on the server that anyone can try to access, including malicious agents. Security considerations are non-trivial.

There are two ways for you to get data to and from the server. You can upload and download files, or you can use REST APIs. If you implement either of these, be sure to also google how to secure them.

 

Also be sure to read article 11 in the Platform Terms of Service, describing your security resposibilities.

View best answer in original post

Best Answer
4 REPLIES 4

Through the companion app, your watch will have access to internet so you will be able to send every information you want to an external web server (http://myjson.com for example)

Best Answer
0 Votes

Hi,

 

Thanks for your reply. Interesting. Where can I read up more on the companion app and it's capabilities? I'm not sure if this will meet my needs yet. As I indicated, I want to be able to record a session/route with the accompanying time, gps, and hr information between a start and stop.  Can I tell/configure the companion app to do this?

 

In other words, can the companion app be configured to do what I described above and then send this data to a custom service I built on the back end as a web api post request with something like session or route id, time, hr, and gps?

 

I appreciate your assistance. I am researching sensors and trying to determine which api can do what I need for my needs. 🙂


Thanks,
Heath

Best Answer
0 Votes

Your options are:

 

(1) Download activity data from the web API. This option only requires minimal programming.

(2) Write a FitBit app that collects activity data from the device and transfers it to the companion, which then uploads it to your server. The native phone app then downloads it from the server.

(3) Write a FitBit app that collects its own data for your own activity sessions and then transfers it to the companion for upload, as in (2).

 

Options (2) and (3) take serious thought about security, unless you're only copying your own data (and you don't care about its security). In order to upload to a server or download from it, you have to use an end point on the server that anyone can try to access, including malicious agents. Security considerations are non-trivial.

There are two ways for you to get data to and from the server. You can upload and download files, or you can use REST APIs. If you implement either of these, be sure to also google how to secure them.

 

Also be sure to read article 11 in the Platform Terms of Service, describing your security resposibilities.

Best Answer

Yes my idea was a mix of the jtlapp solutions.

 

You write a Fitbit app (with a companion).

On the watch, you periodically collects the health information (steps, HR, ...)  from the device activity data because the webapi will not give you precise information + gps location (using the embedded gps) + timestamp with the current date. And you store it locally on the device with the File API (in json format for example).

This will work even if you don't have a phone nearby.

When the number of records is big enough and when the device is connected to the phone, you can send your file to the companion part of your app that will just forward the content to your external server (you can use what I gave you for simple tests).

 

Of course, there are security problems but for a personal research app, it should be okay

Best Answer