Android stream recording performance

I register sensor data (accelerometer, compass, Wi-Fi) on Android with a frequency of 5 Hz. I do not often browse wifi.

I am using a text file. When I have 1000 records of data in memory, I add them to a text file.

However, this method seems rather slow. Will using a SQLite database be faster than a regular text file?

+3
source share
1 answer

One approach may be to use a double buffered list, when one queue is full, starts filling in the next, and in the meantime, another thread writes the entire queue to disk asynchronously, and then flushes (and then continues to repeat).

, n- , .

+1

Source: https://habr.com/ru/post/1778700/


All Articles