You're currently reading a byte at a time, because you're using InputStream
. That's the first thing to fix - you should be using a Reader
for text data. The best approach is to wrap your InputStream
in an InputStreamReader
.
Next, it sounds like you want to read a line at a time rather than just a character at a time. The easiest way of doing that is to use a BufferedReader
wrapping an InputStreamReader
.
(If you were using Java 7+, all of this could be achieved very nicely using Files.newBufferedReader
- you just need to supply the Path
and the Charset
. Until Android supports that, you'll need to just do the wrapping manually. It's not too painful though.)
One you're reading a line at a time, you then need to split the line by comma - look at using String.split
for this. I would then suggest you create a class to store these two separate values. So each line will be transformed into an instance of your class.
Finally, create a List<YourCustomClass>
and add to it as you read the file.
That's given an overview of how to achieve each step - hopefully enough detail to enable you to get going, but not spoon-feeding you enough to hamper you actually learning from the experience.