05-23-2021 00:48
05-23-2021 00:48
Is Companion considered as FitBit Versa3?
Is App considered as FitBit App?
How do I Transfer a TextFile from Versa3 to Android Phone. Since Git is not working on SDK5. Is there a way for us to get a sample for Versa3 to transfer Acceleration data to Android Phone as a TextFile.
Thank you!
05-23-2021 16:34
05-23-2021 16:34
I don't understand the questions very well. Terminology may be the issue. This may help, or may be irrelevant:
That said, the term "app" is rather ambiguous. It can refer to the Fitbit app, or to a complete Fitbit SDK project (including watch and companion parts), or specifically to the watch part of such a project. Since you seem to be contrasting 'app' with 'companion', you may mean the last-mentioned definition.
In addition, projects that aren't clockfaces are called apps to distinguish them from clockfaces, but in some contexts, a clockface is considered to be a type of app.
Sometimes context is the best way to work out what's being referred to.
05-24-2021 09:25
05-24-2021 09:25
Thanks for clarification. I was way off! So SDK5 File Transfer Project is transferring data from phone to Versa3. But I am trying to get Versa3 to send acceleration data to phone as a TextFile. Is there a tutorial. If not can someone either create a tutorial or a sample for SDK5.
Thank you!
05-25-2021 05:45
05-25-2021 05:45
Create a new SDK5 project, then you'd need to combine the accelerometer guide with the file transfer guide.
https://dev.fitbit.com/build/guides/sensors/accelerometer/
https://dev.fitbit.com/build/guides/communications/file-transfer/
05-25-2021 12:09
05-25-2021 12:09
Thank you. So when I open FitBit Studio would you like me choose FileTransfer or Sensors template to create the project framework?
05-26-2021 02:39
05-26-2021 02:39
I'd probably just start with a blank template and follow those guides, starting with collecting the accelerometer data, then transferring that data.
05-26-2021 10:30
05-26-2021 10:30
Thank you. I created a project using a File Transfer template simply because it has all the folders needed like companion, resources and app. This project runs successfully. But my understanding from @Gondwana that is File Transferring from the phone to Versa3.
Your link to File Transferring says
The File Transfer API allows developers to easily and reliably transfer binary and text files from the mobile companion to the device, even if the application is not running on the device.
But this is going to help me transfer from Phone to Versa3 which is what The Studio Template created???? I want the reverse!
Thank you!
05-26-2021 12:27
05-26-2021 12:27
If you take a look at the file transfer guide, you can see examples of each direction.
Device > Companion
Companion > Device
For your use, you want to use the File Outbox on Device, and the File Inbox on the Companion.
05-26-2021 13:47
05-26-2021 13:47
I think the main hurdle is going to be getting the 'file' from the companion to the phone's file system. 'File transfer' delivers the file to the companion as the contents of a variable, and the Fitbit OS API doesn't provide access to the phone's file system. Hence my previous suggestions to research fetch() or WebSockets.
05-29-2021 14:11
05-29-2021 14:11
I posted a solution twice...but they keep disappearing...what am I doing wrong?
06-01-2021 23:31
06-01-2021 23:31
I posted a solution twice...but they keep disappearing...what am I doing wrong?
06-02-2021 09:56
06-02-2021 09:56
I like to build on @SunsetRunner about this being a Great Community.
What happened to my solution I posted here. The community could contribute to it if it was visible! I still don't know how to debug it.
06-02-2021 10:07
06-02-2021 10:07
Thank you!
can you point me to a working sample here or at GIT or elsewhere. The documentation to what you suggested are very cryptic at best. But you are right that looks like the crux. Some working sample will help significantly!
Thank you!
06-02-2021 10:08
06-02-2021 10:08
Thank you!
can you point me to a working sample here or at GIT or elsewhere. The documentation to what you suggested are very cryptic at best. But you are right that looks like the crux. Some working sample will help significantly!
Thank you!
06-02-2021 10:10
06-02-2021 10:10
@JonFitbit I posted a solution twice...but they keep disappearing...what am I doing wrong?
06-02-2021 10:27
06-02-2021 10:27
I'm not sure what you're posting. A code sample shouldn't disappear unless it contains questionable language? Try posting a link to the code instead. You could put it as a gist on github, or perhaps pastebin?
06-02-2021 13:42 - edited 06-02-2021 13:43
06-02-2021 13:42 - edited 06-02-2021 13:43
I can't easily provide an executable for the Android version because it would seem to be a major security risk and would be blocked from uploading/downloading. I can't publish it to the Google Play store because it's not of sufficient quality, and it only does one specific thing in one specific way which will probably suit exactly nobody. It's really only useful as a bunch of source code to show the general approach since it would need to be adapted.
I'd be most interested to know what your other solutions were. It's possible that a forum moderator might be able to investigate why posts have disappeared.
06-02-2021 13:44
06-02-2021 13:44
import document from "document";
import { outbox } from "file-transfer";
import fs from "fs";
import { Accelerometer } from "accelerometer";
const accelLabel = document.getElementById("accel-label");
const accelData = document.getElementById("accel-data");
06-02-2021 13:50
06-02-2021 13:50
I attempted to post again in fragment. Look like I posted one fragment. Second fragment disappeared. Please have moderator help us!
06-02-2021 14:00
06-02-2021 14:00
This may not help, but it's possible that inserting code as a code sample might work better. To try this, click ... at the right side of the post toolbar thing, then </>, then paste your code in the box that appears.