How to get the internal and external sdcard path in android

前端 未结 8 542
北恋
北恋 2020-12-09 09:23

Most of the new android devices have an internal sdcard and an external sdcard. I want to make a file explorer app but I can\'t find out how to get the path to use in my app

8条回答
  •  Happy的楠姐
    2020-12-09 10:13

    There is no public api for get internal/external sdcard path.

    But there is platform api called StorageManager in android.os.storage package. see http://goo.gl/QJj1eu .

    There are some features such as list storage, mount/unmount storage, get mount state, get storage path, etc.

    But it is hidden api and it should be deprecated or broken in next android release.

    And some methods need special permission, and most are not Documented.

提交回复
热议问题