Reading Unicode Text from Assets

Trying to read utf-8 encoded file in android ...

InputStreamReader reader = new InputStreamReader(assets.open("data.txt"), "UTF-8");
BufferedReader br = new BufferedReader(reader); 
String line;
//The line below throws an IOException!!
line = br.readLine();

What is wrong with this code?

+5
source share
1 answer

It looks like the file is too large, you need to split it into several files (maximum 1048576 bytes for each) or find another way to reduce the file size. Here is an article on a similar issue http://androidgps.blogspot.com/2008/10/dealing-with-large-resources.html

+4
source

All Articles