I have a txt file named "codecs", size is 3M, under the directory "res/
raw/".

This file has been splited to 25 files by the first character of each
line, such as "codecs_a, codecs_b, codecs_c, ......, codecs_y".
And,each of the files contents are sorted by the first colum (ASC).

Now,  I use the folowing code to read the file content.
InputStream is = Resources. openRawResource(R.raw.codecs_a);
InputStreamReader isr = new InputStreamReader(is , Charset.forName
("UTF-8"));
BufferedReader br = new BufferedReader(isr );
....
br.readLine(); //get file content line by line
....

In this method , when I input a number(the first column of the file
content), I can access the content . But it is so slow.......

For example:
Contents of file "codecs_a" :
----------------------------------------------------------------------------------------------------
COLUMN 1               COLUMN 2                         COLUMN 3
----------------------------------------------------------------------------------------------------
1                              This is the first line.
DataData
2                              Android Developers
technology
.......................

10254525                  developers get started         developing
----------------------------------------------------------------------------------------------------

When I input 1 or 2, search speed is fast , but when I input 10254525,
it's so long time to wait for search result.

Is there any way to improve this program?


Thanks for your attention!
by yakebao

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
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