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

Process permanence / life span

ANSWERED

I made a watch face.  It's pretty cool.  I don't have significant experience with java script; 

I added tracking for steps per hour (just visually);  it's primitive, does it manually; however, what it revealed to me this morning is that my watch face program terminates when i start my treadmill tracking activity.

 

I only know this (or think i do) because my hourly count was reset after my treadmill activity (which didn't cross any hourly boundaries);  I keep track of the last "HOUR" and when the current hour is different, i reset my hour-start-step variable back to the current step count.   to figure out the difference (the current steps THIS hour), i simply subtract the hour-start-step count from the current step count.

 

So my actual question is....  Is there a way to maintain variables between executions where my program might start & stop?   I also tend to use "let" instead of "var" in creating variables / assigning values -- would it make a difference if i used var instead of let?

 

thanks in advance.

 

 

 

Best Answer
0 Votes
1 BEST ANSWER

Accepted Solutions

You can persist information by using the File System API.

https://dev.fitbit.com/guides/file-system/#overview

I hope that helps 

 

View best answer in original post

Best Answer
0 Votes
2 REPLIES 2

You can persist information by using the File System API.

https://dev.fitbit.com/guides/file-system/#overview

I hope that helps 

 

Best Answer
0 Votes

Well... that's logical..  is it costly to read & write data?  all i really want to do is to keep the current step count at the start of a given hour, so i guess if i read/write once an hour that won't be too terrible.

 

Thanks!

 

 

Best Answer
0 Votes