简体   繁体   中英

Best/Simplest ways to store Android data

I am building my first Android app. I want to collect opt-in data from the user (let's say input data), save it and ultimately view it as a CSV.

I attempted to use the Google Sheets API, but reached a dead end. I'm wondering if there are alternative ways to store data.

The data will be fairly large (the data will be collected every few minutes for several hours) So I don't want to take up too much storage space on the user's phone. I'd love to upload the data to some sort of cloud, but am lost outside of Google Spreadsheet API

A very common solution is to create a Database. SQLite offers a lightweight and snappy experience in Android. Data will be stored persistently until app uninstallation, app data cleared in settings or altered by the user in-app (if you wish to implement such function).

Saving Data in SQL Databases

Later on you could export the data from the database by creating a CSV file. The solution to this last bit was already answered here .

The data will be fairly large (the data will be collected every few minutes for several hours) So I don't want to take up too much storage space on the user's phone.

If data will require X amount of space, X will be the minimum required to store it. The best thing you can do is to use a system that does add too much overhead (again, SQLite is very good at this if you tailor well your tables in the database).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM