Get External SDCard Location in Android

后端 未结 4 1763
别那么骄傲
别那么骄傲 2020-12-29 10:50

I have an app with huge data pre-stored in the SD Card.

We are supporting all tablets ICS onwards. I am not able to find a way to access the SDCard

4条回答
  •  借酒劲吻你
    2020-12-29 11:47

    If you are trying to get the path to the SD card use this code

    String baseDir = Environment.getExternalStorageDirectory().getAbsolutePath();

    Then use this to get the path of the specific folder/file

    String path = baseDir + "/your folder(s)/" + fileName;

提交回复
热议问题