E
E
Eugene2015-06-06 22:01:22
Android
Eugene, 2015-06-06 22:01:22

What is the best way to store data in an Android application?

In general, the application should draw such fingerings:
936d56c3a79d4a0f9bba123d0c681dca.png
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

2 answer(s)
O
Oleg Gamega, 2015-06-06
@gadfi

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.

M
micsha, 2015-06-07
@micsha

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 question

Ask a Question

731 491 924 answers to any question