I will develop an android application with a lot of data (json files with some rows and CSV for graphics data with a lot of rows) , this data change every 5 minutes and replaces all the previous data (or mostly).
What are the best approaches to design this ? I have 2 options:
-
Save all the data in a sqlite db, and sync this by a IntentService.
-
save the data in json and csv files and replace this every 5 minutes.
Which approach will the best performance?
This considering the time to parse the files, sorting data, the download time and the consistency of data.
any other ideas?
PD:I need a cache system too, in case if i don’t have internet and I need the previous stored data
Sqliteis mostly used when you want data to be saved and used in future. In your case data is changing every5 minutesso its better to haveJSONbecause every time to make theDatabase connectionstoreandretrieveafter5 minuteswill take some time.UPDATE:
I also had the same Application in which the data was changing every time. In that case I used
Map<K, V>andArrayListto maintain the values, because as the data is changing everytime I think its not feasible to store the data in Sqlite everytime. It needs much time to perform DB Connection store, retrieve, update the data in Sqlite.