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

Access phone (companion) internal storage and write file to a specific path

ANSWERED

Hi everyone.

I'm developing an app that collects raw accelerometer data from an Ionic device and save them to an internal file in the Ionic device.

I'm then using the Message API to send chunks of those files to the companion app (since FileTransfer API only allows to go from companion app to fitbit device).
What I would like to do next is saving those data to a specific file in some folder of the companion device (my phone). 

Is there any way to do that? 

The only way I can use those data and process them for my research seems to be by pushing them to a web server; which I don't have and also takes a little more time. 

Another stupid way to do it is to log the meaningful data, and share it going to the Fitbit app under "developer menu -> click on the app on development -> Logs" which is really really bad not only because those data needs a little parsing, but because is massively goes against the principals of programming since it requires a human input.

Best Answer
0 Votes
1 BEST ANSWER

Accepted Solutions

I have seen some developers create a local webserver on an Android phone, but I'm unsure of the mechanics of that, other than they use fetch() in the companion to send data via post. Or you can post the data to a webserver on the local network, or internet.

 

https://stackoverflow.com/questions/29775797/fetch-post-json-data

 

View best answer in original post

Best Answer
0 Votes
4 REPLIES 4

The only way to get data is via a webserver. That can be local or remote, but iOS doesn't provide a method for sharing data or messages between apps.

Best Answer
0 Votes

@JonFitbit wrote:

The only way to get data is via a webserver. That can be local or remote, but iOS doesn't provide a method for sharing data or messages between apps.


I see. Thank you.

Is there any documentation on how to use a local server? And by local, do you mean on the device itself? Which would be the phone where the companion app is running? (I'm running Android).

If no documentation is available for that purpose, will I be able to use the general JavaScript code that lets me push that data to a remote folder on a Cloud storage (let's say OneDrive)?

Best Answer
0 Votes

I have seen some developers create a local webserver on an Android phone, but I'm unsure of the mechanics of that, other than they use fetch() in the companion to send data via post. Or you can post the data to a webserver on the local network, or internet.

 

https://stackoverflow.com/questions/29775797/fetch-post-json-data

 

Best Answer
0 Votes

@JonFitbit wrote:

I have seen some developers create a local webserver on an Android phone, but I'm unsure of the mechanics of that, other than they use fetch() in the companion to send data via post. Or you can post the data to a webserver on the local network, or internet.

 

https://stackoverflow.com/questions/29775797/fetch-post-json-data

 


Sounds good. I'll look into it. Thanks for that

Best Answer
0 Votes