I have some reference data in a text file (~ 5 MB) that I want to use with the android application for applications.
The file has the format:
1|a|This is line 1a
1|b|This is line 1b
2|a|This is line 2a
2|b|This is line 2b
2|c|This is line 2c
What I want to know is the most efficient way (less memory, faster, size, etc.) to use this file in my application.
a.) Should I save the file as a raw resource and open and read the entire file whenever I need a specific line.
b.) Should I convert the file to XML and use XPath to query the file when I need to find the value
<data>
<line number="1">
<entry name="a">This is line 1 a</entry>
</line>
</data>
c.) Should I just copy and paste the whole file as a static array of strings into the application and use it.
... any other suggestions are welcome.
[EDIT]
, . " 1a".