0

I want to get list of paths of all available storage drives for example internal memory, Memory card, usb otg drive etc.. At least give suggestions to get path of removable storage.

Sanket Bhat
  • 340
  • 3
  • 16
  • For the most part, all that is done from the [`Environment`](https://developer.android.com/reference/android/os/Environment.html) class. There's not one method to list all directories – OneCricketeer Nov 10 '16 at 15:49
  • Moreover, [you do not have arbitrary access to most of that ("Memory card, usb otg drive") through the filesystem on Android 4.4+](https://commonsware.com/blog/2014/04/09/storage-situation-removable-storage.html). – CommonsWare Nov 10 '16 at 15:52
  • See this answer by Ardock for an in-depth analysis. http://stackoverflow.com/a/40201333/940834 – IAmGroot Nov 10 '16 at 15:54
  • If you are on Android 7 and above the `StorageManager` will gladly tell you which `StorageVolumes` are available. – greenapps Nov 10 '16 at 15:54
  • For Android 5, 6 and 7 you can also look at `getExternalFilesDirs()`. – greenapps Nov 10 '16 at 15:56
  • What is the string argument for getExternalFilesDirs (String s) – Sanket Bhat Nov 10 '16 at 17:03
  • Make it `null`. As you can see with a simple Google. – greenapps Nov 10 '16 at 19:27

0 Answers0