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

How to modify Fitbit sdk-exercise example to include user selected exercise?

Im trying to make personalized version of the Fitbit sdk-exercise app example, allowing the user to select the exercise with the app settings menu. However, I am a bit stuck due to being novice to the layered constructors nature of the sdk-exercise example. 

I would like to change the config.js file from "export const exerciseName = "run" " to an ExerciseName retrived from the settings/index.jsx. In the end, I keep just getting that the exercise returned is undefined.

 

I have created a Github Gist of the relevant code: Gist

 

Any help appreciated.

Best Answer
0 Votes
1 REPLY 1

I don't have a full example, but if you take a look at the Alpine Snow app, you'll see the companion send a file to the device, and the device reads data from that file.

 

You could send your user selected exercise in a file:

 

Send a file to the device

https://github.com/orviwan/alpine-snow/blob/master/companion/index.js

 

Receive the file

https://github.com/orviwan/alpine-snow/blob/master/app/lib/incoming.js

 

Start listening for files

https://github.com/orviwan/alpine-snow/blob/master/app/index.js#L5

 

Read data from the file

https://github.com/orviwan/alpine-snow/blob/master/app/subviews/weather.js#L26

 

Then you can use the user selected exercise name when starting your exercise.

 

I hope it helps.

 

Best Answer
0 Votes