The trick is to avoid any substringing while parsing.  Read into a
char array and then use String(char[] value, int offset, int count)
to construct the individual string, after parsing its bounds.  And you
can speed that up by also having another file that is a "dope
vector" (int[]) for the string locations in the char file.

In fact, for some uses you could forgo the construction of the strings
until they're referenced, using the dope vector.

On Aug 19, 10:01 am, Mark Carter <[email protected]> wrote:
> I've got a map of about 500 entries. Strings are all very short (less
> than 5 chars).
>
> Its read-only data I want to read once at app-startup.
>
> What's the best way to store this so that loading this data is fast?
>
> I've tried storing the data in a CSV in res/raw but this takes about
> 700ms to parse on my N1, so I'm hoping there's a faster way...

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to