Samsung Galaxy S3 has an external SD card slot, which is mounted to /mnt/extSdCard
.
How can I get this path by something like Environment.getExter
I was using Dmitriy Lozenko's solution until i checked on an Asus Zenfone2, Marshmallow 6.0.1 and the solution is not working. The solution failed when getting EMULATED_STORAGE_TARGET, specifically for microSD path, i.e: /storage/F99C-10F4/. I edited the code to get the emulated root paths directly from emulated application paths with context.getExternalFilesDirs(null);
and add more known phone-model-specific physical paths.
To make our life easier, I made a library here. You can use it via gradle, maven, sbt, and leiningen build system.
If you like the old-fashioned way, you can also copy paste the file directly from here, but you will not know if there is an update in the future without checking it manually.
If you have any question or suggestion, please let me know