Answer the question
In order to leave comments, you need to log in
What is the best way to store data in an Android application?
In general, the application should draw such fingerings:
The drawing mechanism is based on a custom view and the drawing of points is based on an array that serves as a kind of "switch" if 0 is not drawn, 1 is drawn, 2 is drawn in a different color, so now the question is how best to store these arrays , directly hardcode into the code or use the database?
Answer the question
In order to leave comments, you need to log in
Describe the task in more detail, do you use the name of the chords? Will there be lyrics and chords somewhere? and so on.. on the basis of this, choose.
In my opinion, in any case, it is better not to hardcode, because. there can be a huge number of such fingerings, which can negatively affect the readability of the code.
Plus, the use of the database provides opportunities for expanding the application, adding new objects, removing unnecessary ones.
Again, if you are so sure that there will be no more changes to the set of fingering objects, then ... Take JSON, and throw an array of data there - and the file itself in /assets. The idea is so-so, but if you really want to hardcode, then it's better that way.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question