开发者

Android App Data - Constantly Writing data to in a readable format

开发者 https://www.devze.com 2023-03-23 08:01 出处:网络
I\'m making an app which constantly receives Heart Rate from a bluetooth device in a serial (Byte) format. I want to be constantly saving this data on to a file on the droid. Whats the best way?

I'm making an app which constantly receives Heart Rate from a bluetooth device in a serial (Byte) format. I want to be constantly saving this data on to a file on the droid. Whats the best way?

The data should not be overwritten, rather added to the end of file.

Kind of like notepad applications.

I have seen a few options like database or file stream. I have no experience with database. And with file stream I'm just worried that if its a big file, I have to read the file, and wri开发者_如何学编程te at the end of this (this being done at every data received from HR can be quiet time consuming)

Please advise, and possibly some tutorials for me to look at?


Use databases, you'll get along in no time, just look for examples or read the Documentation. Try keeping record for week or month. Avoid adding on the infinite number of information.

Here is awsome tutorial on databases:

http://www.screaming-penguin.com/node/7742


I would suggest that a database is definitely the way to do. I do something very similar with a bluetooth device and I store all the readings I get in a database.

There are a number of tutorials available. I did a quick Google search and this one looks quite good: http://www.vogella.de/articles/AndroidSQLite/article.html


Zephyropen is an open source Health Monitoring application that just does that.

Zephyr Open is a code project to provide a framework for BlueTooth Physiological Sensors. Heart rate Monitors and Wii Remotes are obvous starting point, but we will continue to grow the device list as they enter the market.

You can contribute to this project if you like.

0

精彩评论

暂无评论...
验证码 换一张
取 消