Search code examples
androidtextcharacterbufferedreaderfilereader

How to read a text file character by character in android?


I would like to know how can I read a text file from assets character by character.

For example, if I have this file "text.txt" and inside of it "12345", I would like to read all numbers one by one.

I've already looked for this but I can't find any solution.

Thanks.


Solution

  • Use getAssets().open("name.txt") to retrieve an InputStream on assets/name.txt, then read it in as you wish.