Hey, I've got a large amount of Strings which i use into my application, the .txt file which i use has ~14000 lines.. and every 3-10 line is split into sections like
<String="Chapter I"> ... </String> ..
Talking about performance/speed, must i place the sections right into a Database, Or read line by line with the .txt file and appearance when the section number may be the current one? Will this affect speed/performance?
I possibly could also divide each ~2000 lines right into a different .txt file so there'd be less lines to undergo. Is a poor method of storing data? Thanks
I believe sqlite would have the desired effect. It'll most likely be way faster than parsing a text file, plus you won't be required to keep up with the headache of your random text database, or develop a parser to begin with. Essentially, utilize it, its way simpler.
The conventional way to cope with Strings in Android would be to place them into res/values/strings.xml (I am confident you could have multiple String files for the reason that directory if you want). If you're developing in Eclipse it'll instantly populate the R class (the resource class) with constants which you can use to reference these Strings inside your code:
Or perhaps in XML designs:
Or maybe you are doing some thing custom you should use:
String string = getString(R.string.hello);
I'd certainly choose this on the .txt file. It's much simpler. Everything is accomplished for you! Possess a read of this Android article about this.
This is exactly what a database is perfect for. Utilize it.