Finally found a working solution , but its not recomended, to get to external sd card i used hard coded path , like /storage/extSdCard/StorageTest/input
but this path depends upon device , the above path works in Samsung Galaxy note series but for xperia Z its /storage/removable/sdcard1
. This solution worked for me because my client use a specific device.But like this you cant create a global method which works on every device, so here is the code which worked for me
String galaxy_note = "/storage/extSdCard";
File file = new File(galaxy_note
+"/StorageTest/input");
you can also check if there is a removable sd card installed in device or no by using
Environment.isExternalStorageRemovable();