Answer the question
In order to leave comments, you need to log in
Which should I choose to store JSON or sqlite data?
Data comes from the server in JSON format.
[
{
"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"
}
]
}
]
Answer the question
In order to leave comments, you need to log in
About memory, look somehow in the studio how much the memory application takes. the amount of your data is trifles.
about how to store.
make everything easier. if there is no question (urgent) on optimization - do it simply. For example, often a few lines with gson are enough to parse json into objects. For room there are more lines. For pure sqlite, you already need to work hard.
Further. Premature optimization is evil. Now you don’t even know how your application will change and what bottlenecks it will have. Therefore, it is premature to complicate something like shooting blind.
Further. One hundred pounds that if the application is useful and will live long, then there will be changes. Therefore, the task is to break the application into 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. This agreement is "formalized" in the application by the interface. For example a repository. Those. the first part uses the repository (via its interface). The other part provides the implementation of the repository. For example, through json text parsing.
This makes it possible, if necessary, to quickly replace the implementation of the repository so that it takes data from the database. Without changing anything else.
more or less like this)
It is most efficient to store in a database.
You can then extract it even in JSON, even in XML, or display it on the web, whatever you like.
And parsing files is not writing requests. There is no flexibility in the parse.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question