Following may be useful, which I have taken from android developer site.
In order to read or write files on the external storage, your app must acquire the READ_EXTERNAL_STORAGE
or WRITE_EXTERNAL_STORAGE
system permissions.
You can set the permissions in your manifest file like this:
...
Here are a couple methods you can use to check the availability:
/* Checks if external storage is available for read and write */
public boolean isExternalStorageWritable() {
String state = Environment.getExternalStorageState();
if (Environment.MEDIA_MOUNTED.equals(state)) {
return true;
}
return false;
}
/* Checks if external storage is available to at least read */
public boolean isExternalStorageReadable() {
String state = Environment.getExternalStorageState();
if (Environment.MEDIA_MOUNTED.equals(state) ||
Environment.MEDIA_MOUNTED_READ_ONLY.equals(state)) {
return true;
}
return false;
}
Read the file content as given below. After that you can process,
final File file = new File(Environment.getExternalStorageDirectory()
.getAbsolutePath(), filename);