Sorry if this is a dumb question, but I'm having a little trouble understanding how to access intra-day data on the app I'm trying to create.
How do you access intra-day data when building an app through fitbit-studio?
Do you need any special permissions or anything? Or is it different for apps, because they're localized within the device themselves? Do I need to use the Web API or something?
If anyone has any examples that would be greatly appreciated 🙂
Answered! Go to the Best Answer.
Yes, I'm afraid you're stuck with the Web API in that case.
Best AnswerYou can collect your own intra-day data while your app is running, which could sidestep the issue for you.
However, in general: yes, you'd need to use the Web API to get the intra-day data from Fitbit's servers. This is only updated whenever the watch syncs, so it isn't real-time.
The most relevant example is probably this. Whether there are extra hurdles depends on exactly what data you want.
Best AnswerCollecting the intra day data while the app is running is definitely what I'm after!
I'm hoping to sidestep the Web API completely.
Basically what I need to do is when the user presses a button on the screen I need to get their steps from the last time they pressed that button and now.
I also want to get the times their heart rate was in the "fat burn", "cardio", and "peak" zones so I can multiply the steps from those times by some values, and then do what I need to do within the app.
I think I know how to do it from within the Web API with a lot of get requests and OAuth and stuff, but I don't think that's the best course of action when I'm building for the device itself.
I can't find anything within the guides/references about accessing intra-day data from the Device API - would you have any other examples about that?
Best AnswerThe official examples are here; there's a heart-rate one.
Doco for getting steps is here. I think there's a github repo of third-party apps somewhere; one of those is bound to include steps.
Just be aware that, if the user opens another app, yours loses consciousness. It won't run in the background, and any data you need to keep track of (eg, prior readings) will need to be stored and retrieved.
Best AnswerAh, I've seen that all before. The issue about that is the hrm is real-time and the user activity for steps seems to be limited to that day only.
That won't work for me because if a user doesn't use my app for a day or something, I want to be able to collect their steps from the previous day.
I assumed my app won't run in the background - I save the data every sync 🙂 .
It seems like I'm going to need to find a way to get through the Web API.
Thank you for all your help 🙂
Best AnswerYes, I'm afraid you're stuck with the Web API in that case.
Best Answer