简体   繁体   中英

Which path point to the internal storage when get a list of all paths of the “external storage”?

"external storage" can be a removable storage media (such as an SD card) or an internal (non-removable) storage. When there are both internal(non-removable) storage and removable SD card, I can get all the paths of the storage through two files: "scanning /proc/mounts"and "/system/etc/vold.fstab".

However, I don't know which path point to the internal(non-removable) storage. Most devices point "mnt/sdcard" or "storage/sdcard0" to the internal storage according to the vesion of Android Sdk( before Android 4.1 the path is "mnt/sdcard; after Android 4.1 the path is "storage/sdcard0"). But some devices point that path to the removable SD card. Therefore, I don't have some efficent method to divide them. I am waiting for your help. Thank you!

No removable memory device will support in android. Those are outside the bounds of the Android SDK at this time. The Android SDK only supports standard external storage, not anything else.

Environment.getExternalStorageDirectory method (it returns the string /mnt/sdcard). The data goes in to the external memory but not the removable SD card.

But if you want external sdcard then check the below links. It may help you to get external mounted devices

Find an external SD card location

Android – Find all sdcards (internal and external)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM