11-27-2018 23:42
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

11-27-2018 23:42
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Hi, Is there any any limitation for size of file we can store using File API in Fitbit ionic ?

11-28-2018 12:44
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post


11-28-2018 12:44
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
You have 10mb in the file system including your app and its resources, but I don't think there's an individual file size limit.

11-28-2018 22:14
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

11-28-2018 22:14
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Accelerometer and Gyroscope without breaking the application ?

11-28-2018 22:22
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post


11-28-2018 22:22
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
- Who Voted for this post?
I've managed to store a whole day's data comprising energy, distance, steps, active minutes, altitude and heart-rate, sampled at 15-second intervals. This took me six files of 11,522 bytes each (with each value stored as an Int16 to conserve app memory).
Gondwana Software
11-28-2018 22:31
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

11-28-2018 22:31
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
to store the data? From your reply I got a an idea that we can't store
these datas in a single file , Is it correct?

11-28-2018 22:39
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post


11-28-2018 22:39
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Sorry, I mislead you. One large file should be fine, so long as you don't try to get it all in memory at once.
I used Int16Array for in-memory buffers. You can read and write these to binary files using, eg, writeSync().
Gondwana Software

12-01-2018 12:36
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

12-01-2018 12:36
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
@Gondwana After reading, how to remove the corresponding buffer from the binary file?
or is there any possibility to remove data from the binary file?
thanks

12-01-2018 12:54
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post


12-01-2018 12:54
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
I don't think you can truncate a file, but you can write new data to any location within it. I use this method, and keep track of which bits of the file contain valid data using in-memory variables (carefully saved and restored when necessary). You could also write 'invalid'/'empty' sentinel values to the file.
This is perhaps inefficient, but I've found that it's a lot quicker to create a fixed-length file and then use it like an array, reading and writing data in blocks whenever possible. Iterating through hundreds of values in JS code can get your app killed for unresponsiveness (although you could put timeouts in slow code, but then you have to deal with possible events while your data is in an indeterminant state).
In my case, I knew that I'd want a value for every 15 seconds, so I just use files that contain exactly 24*60*60/15 Int16s. To avoid having to create and initialise such files on the device (which is slow), my app ships with a pre-created empty file of that length. Duplicating it is quick because it can be done in a few file system calls; no looping is required.
Gondwana Software

