Skip to content

Instantly share code, notes, and snippets.

@PauloLuan
PauloLuan / GetExternalSdCardPath.java
Last active October 31, 2022 07:02
how to get the external sd card path on android.
public static String getExternalSdCardPath() {
String path = null;
File sdCardFile = null;
List<String> sdCardPossiblePath = Arrays.asList("external_sd", "ext_sd", "external", "extSdCard");
for (String sdPath : sdCardPossiblePath) {
File file = new File("/mnt/", sdPath);
if (file.isDirectory() && file.canWrite()) {