Skip to content Skip to sidebar Skip to footer

Dynamically Read Files From Sdcard

Guys i have a text file in sdcard i need to read that file. Below is my code to read files: File f = new File(Environment.getExternalStorageDirectory()+'/f1.txt'); fileIS =

Solution 1:

Try this:

File f = new File(Environment.getExternalStorageDirectory().toString() + "/audio");
if (f.isDirectory())
{
    String files[] = f.list();
    for (int i = 0; i < files.length; i++)
    {
        Log.d("", files[i]);
    }
}

Post a Comment for "Dynamically Read Files From Sdcard"