简体   繁体   English

获取“外部存储”的所有路径的列表时,哪个路径指向内部存储?

[英]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. “外部存储”可以是可移动存储介质(例如SD卡)或内部(不可移动)存储。 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". 当同时存在内部(不可移动)存储和可移动SD卡时,我可以通过两个文件获取存储的所有路径:“扫描/ proc / mounts”和“ /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! 大多数设备根据Android Sdk的版本将“ mnt / sdcard”或“ storage / sdcard0”指向内部存储(Android 4.1之前的路径为“ mnt / sdcard; Android 4.1之后的路径为” storage / sdcard0”)。但是有些设备将这条路径指向可移动SD卡,因此,我没有有效的划分方法,正在等待您的帮助,谢谢!

No removable memory device will support in android. android中不支持可移动存储设备。 Those are outside the bounds of the Android SDK at this time. 这些目前不在Android SDK的范围内。 The Android SDK only supports standard external storage, not anything else. Android SDK仅支持标准外部存储,不支持其他任何存储。

Environment.getExternalStorageDirectory method (it returns the string /mnt/sdcard). Environment.getExternalStorageDirectory方法(它返回字符串/ mnt / sdcard)。 The data goes in to the external memory but not the removable SD card. 数据进入外部存储器,但不进入可移动SD卡。

But if you want external sdcard then check the below links. 但是,如果您需要外部SD卡,请检查以下链接。 It may help you to get external mounted devices 它可以帮助您获得外部安装的设备

Find an external SD card location 查找外部SD卡位置

Android – Find all sdcards (internal and external) Android –查找所有sdcard(内部和外部)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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