哪里是在4.4.2我的SD卡的位置? [英] Where is my sdcard location on 4.4.2?
问题描述
在Android上4.4.2 Environment.getExternalStorageDirectory()。getPath()
返回 /存储/模拟/ 0
但是这条道路并不在我的Nexus5的Android 4.4.2存在。 Environment.getExternalStorageDirectory()。getPath()
工作,直到安卓4.4.2。
我怎样才能在Android 4.4.2 / SD卡
路径?
这个路径不会在我的Nexus5的Android 4.4.2存在。
是的,确实如此,对于你的进程在运行。
例如,此示例项目下载文件到 Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS)
。如果你在运行日志的位置,在一台Nexus 5上运行时,它被报告为 /存储/模拟/ 0 /下载
。而且下载成功。
如果您正在寻找 /存储/模拟/ 0
通过DDMS或 亚行外壳
,你不会找到它。对于这些工具,默认的外部存储的/ mnt /壳/模拟/ 0
。因此,从上面的示例下载的文件出现在的/ mnt /壳/模拟/ 0 /下载
目录。
AFAIK,所不同的是依赖于提供独立的外部存储到二级帐户。
On Android 4.4.2 Environment.getExternalStorageDirectory().getPath()
returns /storage/emulated/0
but this path does not exist on my Nexus5 Android 4.4.2. Environment.getExternalStorageDirectory().getPath()
worked up until Android 4.4.2.
How can I get the /sdcard
path on Android 4.4.2?
This path does not exist on my Nexus5 Android 4.4.2.
Yes, it does, for your process at runtime.
For example, this sample project downloads a file to Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS)
. If you log the location at runtime, when running it on a Nexus 5, it is reported as /storage/emulated/0/Download
. And the download succeeds.
If you are looking for /storage/emulated/0
via DDMS or adb shell
, you will not find it. For those tools, default external storage is /mnt/shell/emulated/0
. Hence, the downloaded file from the above sample appears in the /mnt/shell/emulated/0/Download
directory.
AFAIK, the difference is tied to providing separate external storage to secondary accounts.
这篇关于哪里是在4.4.2我的SD卡的位置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!