views:

129

answers:

1

I have just started with Android development, and facing one issue in the android application.

When application tries to read the data from file (raw resources), it throws IOException on readLine() function. code is as below:

final Resources resources = m_ApplicationContext.getResources();
InputStream inputStream = resources.openRawResource(R.raw.datafile);
BufferedReader reader = new BufferedReader(new InputStreamReader(
   inputStream));

try {
 String line;
 while ((line = reader.readLine()) != null) {

the reader.readLine() function is throwing the exception. Do I need to mention any kind of additional permission for reading the file ?

Thanks in advance.