03-10-2020 04:51
03-10-2020 04:51
Hello!
I am a high school student wanting to make an app for my Fitbit versa lite.
My goal is simple: the user (me) downloads an app on their Fitbit and doesn’t worry about it as it runs in the background and passively collects daily time series data using the Web API. If certain data criteria have been met, the app should show me notifications ("your calculated walking speed for yesterday was 3.2mph, or, you only got 5 hours of sleep yesterday").
However, as a beginner, I am very confused about how I should set this up. Should I first make an "app" on Fitbit Studio? And then can I make call requests from there to the Web API to get my personal data?
If so, how should I configure my Web API registration so that the "callback URL" and other settings work with Fitbit studio?
Sorry if these are very obvious questions. I would really appreciate all your help!
Answered! Go to the Best Answer.
03-10-2020 12:21
03-10-2020 12:21
Apps can't run in the background on the watch. Running in the background isn't necessary to cause the watch to record data that can be accessed via the Web API (although it can only be accessed after the watch syncs, which could be infrequently).
The companion (phone) part can be woken every 5 minutes. That would be the appropriate place to query the Web API. However, the companion can't send notifications to the watch. The best it could do would be to display messages it receives from the companion when the user opens it. But if the user doesn't open it, they won't see anything.
An example app for accessing Web API is here.
You could actually do 100% of what you described using a native app on your phone (eg, Java/kotlin in Android Studio), including sending notifications that would be visible on the watch when any other clockface/app were running.
03-10-2020 12:21
03-10-2020 12:21
Apps can't run in the background on the watch. Running in the background isn't necessary to cause the watch to record data that can be accessed via the Web API (although it can only be accessed after the watch syncs, which could be infrequently).
The companion (phone) part can be woken every 5 minutes. That would be the appropriate place to query the Web API. However, the companion can't send notifications to the watch. The best it could do would be to display messages it receives from the companion when the user opens it. But if the user doesn't open it, they won't see anything.
An example app for accessing Web API is here.
You could actually do 100% of what you described using a native app on your phone (eg, Java/kotlin in Android Studio), including sending notifications that would be visible on the watch when any other clockface/app were running.
03-10-2020 13:53
03-10-2020 13:53
Thank you for your reply @Gondwana!
So just to be clear, I can make an app on Fitbit Studio for the companion phone and have it query intra-data in occasional time periods? Then I just have to connect Fitbit Studio to my phone to install my app on there and have it run?
Or do I have to create a traditional app (Android: Java on Android Studio, or, iOS: Swift on Xcode)?
03-10-2020 14:06
03-10-2020 14:06
I think you should be able to do it all within Fitbit Studio (with the limitations I mentioned before).
I'm a bit unsure about how to get intraday data access through a watch-and-companion app; I've only done it for a web site. The Web API example I linked before may be sufficient. You may need to register your app (see here). But you shouldn't need to go outside the Fitbit system unless you want push notifications.
03-11-2020 19:18
03-11-2020 19:18
Hi again @Gondwana. I apologize for not being completely clear beforehand. I have a Fitbit Versa Lite, and I didn't realize that that makes all the difference when trying to test a companion app. Since there is no developer bridge on my phone, is there any other way to test this app from Fitbit Studio or is there another direction you can point me in?
03-11-2020 20:21
03-11-2020 20:21
Well, to answer my own question: for building and testing apps on the Fitbit Versa Lite you need to create an app on the gallery (GAM) and upload a .fba file. Then you can get a private link for sharing your app with others and use it download it onto your own device/companion.