What to choose to store data in a JSON or sqlite?

0 like 0 dislike
45 views
From the server come in JSON format.
Example:
[ { "currency_name": { "receive": "AFN", "send": "AED" }, "name": "AFN", "denominations": [ { "send_amount": "5", "receive_amount": "65", "order": "1" }, { "send_amount": "10", "receive_amount": "130", "order": "2" }, { "send_amount": "20", "receive_amount": "275", "order": "3" }, { "send_amount": "50", "receive_amount": "725", "order": "4" }, { "send_amount": "100", "receive_amount": "1500", "order": "5" }, { "send_amount": "200", "receive_amount": "3250", "order": "6" } ] } ]

by | 45 views

2 Answers

0 like 0 dislike
about the memory look like some Studio how much is app memory. the volume of your data this stuff.
about how to store.
do all the easier. if there is no question (urgent) optimization - do it simply. For example, often just a few lines with gson to parse json into objects. For room lines more. For pure sqlite need to work hard.

Next. Premature optimization is evil. Now you don't even know how to change your app, and what the bottlenecks will be. So it is premature something to make it any harder to shoot in the blind.

Next. One hundred pounds, if it will be useful and will live long, that will change. So the challenge is to break the application more or less independent parts. How to do it. For example you have a part that displays data and that provides data. And there is some agreement between them. The agreement "executed" within the application interface. For example repository. I.e. the first part uses the repository (via its interface) . The other part provides an implementation of the repository. For example, through parsing the json text.
This gives you the ability to quickly replace the repository implementation, what would it take data from the database. Without changing anything else.
like this)
by
0 like 0 dislike
In the database to store most effective.
To extract then you can even JSON, though XML, or display on the web, whatever.
And the file to parse - no queries to write. Flexibility in the Pars no.
by

Related questions

0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
110,608 questions
257,186 answers
0 comments
33,795 users