Search code examples
androidstorageexternalreadfile

read file from external storage


I simply cannot find how to get one specified file from the external storage. I know that with getExternalStoragePublicDirectory(), you get the external storage directory but I can't get further. I need some kind of method where you have to give the name of the file and it returns the file. Thanx


Solution

  • Better than using File.separator is this, which is standard Java:

    final File file = new File(Environment.getExternalStorageDirectory()
                              .getAbsolutePath(), filename);