-2

i want to know how can we get memory card path. am using

File extMemDir = Environment.getExternalStorageDirectory();

but it return path of mounted storage on device not removable SD card on my samsung device

please help i need path of removable SD card

  • `Environment.getExternalStorageDirectory()` returns the path of external storage directory. That's fine – Raghunandan Jul 16 '14 at 15:57
  • thats not fine .... it return /mnt/sdcard , there will be any method to get path of sdcard – user134929 Jul 16 '14 at 15:59
  • read http://developer.android.com/reference/android/os/Environment.html#getExternalStorageDirectory%28%29 – Raghunandan Jul 16 '14 at 16:01
  • Environment.getExternalStorageDirectory() ever wil return the manufacturer's external storage, sometimes is SdCard, some others is Internal Storage... Here you can get the explanation of this issue http://stackoverflow.com/questions/5694933/find-an-external-sd-card-location and solutions – Leonardo Sapuy Jul 16 '14 at 16:02

1 Answers1

1

There is no reliable way to determine the path to a micro SD card for all devices. On some you can use getExternalStorageDirectory().

If the device runs kitkat you might try to use getExternalFileDirs() which can return several paths.

Make an option in your app so the user can indicate the right path and save the choice in shared preferences.

greenapps
  • 11,154
  • 2
  • 16
  • 19