I was facing the same problem. I didn't know how to access external sd card location. I was developing an app wherein I had to access the external sd card to read and write some stuff. I tried different methods including the pre-defined android libraries. These are the methods I used:-
These were the misses:-
File path = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS);
File myFile = new File(path, "test.txt");
File root = Environment.getExternalStorageDirectory();
File dir = new File(root.getAbsolutePath()+"/Download");
File f = getExternalFilesDir(null);
File file = new File(f,"test.txt");
These all were accessing internal storage "/storage/sdcard0" or "/storage/emulated/0". The reason being in the android device the portion of the internal storage acts as an external storage. So in case you have internal storage of around 16 Gb or more and there is an option to expand the device with sd card, then this is the only way i guess to access the external sd card because even the built-in functions and libraries of the android studio will access internal storage as external storage.
Finally I used this:-
String extFilePath = "/storage/sdcard1/Download";
File myFile = new File(extFilePath, "test.txt");
and it worked. So you see where pre-defined android libraries/functions fail, I was able to do the task with the simple String.
Apart from this if you want to check the path for external storage your device, try this:-
String sdpath,sd1path,usbdiskpath,sd0path;
if(new File("/storage/extSdCard/").exists())
{sdpath="/storage/extSdCard/";
Log.i("Sd Cardext Path", sdpath);}
if(new File("/storage/sdcard1/").exists())
{sd1path="/storage/sdcard1/";
Log.i("Sd Card1 Path",sd1path);}
if(new File("/storage/usbcard1/").exists())
{usbdiskpath="/storage/usbcard1/";
Log.i("USB Path",usbdiskpath);}
if(new File("/storage/sdcard0/").exists())
{sd0path="/storage/sdcard0/";
Log.i("Sd Card0 Path",sd0path);}
Checking these might help you know what path to choose while accessing external sd card. I hope this helps others.