0

How to read a file from a micro SD card in android? Is there a unique path to get the micro SD card path? if yes, what is then? What trick can I use to get the micro SD card path to be able to read a file from?

  • 2
    Does this answer your question? [How to access External Micro SD card of the phone?](https://stackoverflow.com/questions/11716448/how-to-access-external-micro-sd-card-of-the-phone) – sohel.eco Jan 22 '20 at 12:46
  • See https://stackoverflow.com/questions/54972905/android-r-w-to-removable-sd-card/54975343#54975343 – Pawel Jan 22 '20 at 13:01

1 Answers1

0

some might suggest using /sdcard but you should use this instead:

File sdcard = Environment.getExternalStorageDirectory();
saeed foroughi
  • 1,662
  • 1
  • 13
  • 25
  • this method does not exactly return the Micro SD Card path. I wrote a text file using this method, it was saved in my phone storage, not on micro sd card. – Besmellah Ibrahimi Jan 23 '20 at 04:13
  • I tested this. It returns the path to the primary storage (I mean the storage of the device itself). But I want to return the path to Micro SD card (External Memory). – Besmellah Ibrahimi Jan 23 '20 at 14:21