This is a little tricky, and isn’t precisely a version limitation. Here’s why, and how I’ve found the most reliable way to get it.

1. Environment.isExternalStorageRemovable (without parameters) is API 9+, so has broad support. If your devices primary external storage location is removable, then this will return the location you want – done.
2. You can loop through external directories with ContextCompat.getExternalFilesDirs, and test each directory with the Environment.isExternalStorageRemovable single-parameter signature, to see which one is actually removable (versus emulated), but that signature is API 21+, so has limited use.

My strategy is:

1. Check Environment.isExternalStorageRemovable (without parameters) – if not null, then you’re done.
2. If #1 fails, then check Build – if 21+, then loop through ContextCompat.getExternalFilesDirs and use the Environment.isExternalStorageRemovable single-parameter signature to test each File iteration – when true, return that and you’re done.
3. If you still haven’t got a good File from #2, then you can offer the user a list of potential locations with ContextCompat.getExternalFilesDirs and let them select what they believe to the best fit. You can optionally use “hueristics” here to give hints or put the most likely candidates at top.

Here’s the above in some simple static methods. To present the user, you’d probably want a Dialogue with a list of choices, but that’s so arbitrary I felt it wasn’t worth a demo.