To get the internal SD card you can use
String extStore = System.getenv("EXTERNAL_STORAGE");
File f_exts = new File(extStore);
To get the external SD card you can use
String secStore = System.getenv("SECONDARY_STORAGE");
File f_secs = new File(secStore);
On running the code
extStore = "/storage/emulated/legacy"
secStore = "/storage/extSdCarcd"