7

I am facing some storage issue. i am working on an application where i have to access phone's on board external storage and an External sdCard storage which i am getting with this code

Environment.getExternalStorageDirectory();

But when onBoard external memory exists then this code returns the path of onBoard memory not the external sdCard while the sdCard is mounted

now the problem is.. i want to access both memories onBoard and external sdcard is there any way to access both memories

Farrukh
  • 259
  • 2
  • 5
  • 15
  • Please select an answer. – Brett Sep 16 '13 at 20:12
  • Possible duplicate of [How can I get external SD card path for Android 4.0+?](https://stackoverflow.com/questions/11281010/how-can-i-get-external-sd-card-path-for-android-4-0) – crgarridos Nov 28 '17 at 09:52

1 Answers1

1

Try out this:

String m_str = Environment.getExternalStorageDirectory()
               .getAbsolutePath().toString();           //return path sdcard/mnt
Muhammed Refaat
  • 8,914
  • 14
  • 83
  • 118
GrIsHu
  • 29,068
  • 10
  • 64
  • 102
  • This will return the path of build-in storage in my phone. Not the SD card inserted. – rml Jun 25 '13 at 04:09