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

Raw data logging custom application

Hello! I am working on a research study which uses wearable sensors. We need to log raw accelerometer and heart rate data, and we were considering using the Fitbit Sense for this purpose. Our understanding is that the Device API provides access to that data, and that we could write a custom app to log this data for the duration of the study. However, we have a few concerns we were hoping could be addressed:

 

1) Are there any built-in features which would allow us to collect this raw data without writing a custom application? We can do so if necessary, however.
2) We are concerned about the user accidentally exiting out of the application while collecting data unsupervised. Is there a way to run it such that the user cannot exit out easily, like as a background app or in a single-app locked mode?
3) What kind of battery life could we expect while running a custom application that logs this data? Is there a way to make it better optimized for battery life, like running it in the background or turning off the screen somehow?
4) Is there another device in the Fitbit line that we have missed which would better suit our needs?

 

Thanks in advance!

Best Answer
0 Votes
6 REPLIES 6
  1. Yes for heart-rate, but not for accelerometer.
  2. Third-party apps can't run in the background. I wouldn't say that clockfaces can be 'accidentally' exited, but they can be inadvertently closed if the user swipes the screen to change settings, etc. Apps (as opposed to clockfaces) offer more protection: the system doesn't act on swipes, and you can intercept presses of the physical key to prevent immediate exit.
  3. The screen will go off (or enter always-on display mode) automatically. I think battery life would still be good. The greater problem may be achieving reliable communications for extended periods.
  4. Any Versa could also do this.Older Versas can be harder to program because the dev environment and documentation have been partially deprecated, but if you can get a bargain... You might also want to consider whether you might want gyro data, since accel data doesn't indicate direction (orientation) in terms of up, down, etc. Sense has gyro, but currently-available Versas don't.

The architecture of a system to collect accel data is messy. Accelerometer Fetcher here may help. I think there are bugs in that (or the Android side of it) somewhere.

Peter McLennan
Gondwana Software
Best Answer
0 Votes

Thank you @Gondwana .   I'm moving this post to the SDK forum.

Gordon Crenshaw
Senior Technical Solutions Consultant
Fitbit Partner Engineering & Web API Support | Google
Best Answer

Ho @Gondwana - you mention it is possible to detect swipe right [close] in an app on a Sense, do you know how?

 

See How to stop an App closing with Swipe right?

 
 

Author | ch, passion for improvement.

Best Answer
0 Votes

Use preventDefault in beforeunload listener.

More here.

Peter McLennan
Gondwana Software
Best Answer

I'll test again but think it only applies to the watch back button.

Author | ch, passion for improvement.

Best Answer
0 Votes

Thanks@Gondwana  - unless this is not the process it doesn't block swipe right

 

document.onkeypress = function(evt) {

 console.log("Key press ");

evt.preventDefault();
}

 

Pressing the button is detected - Swipe right isn't

 

Update: It needed this to work

document.addEventListener("beforeunload", (evt) => {

Updated How to stop an App closing with Swipe right?

Author | ch, passion for improvement.

Best Answer