[英]How to get emulated storage path on Android 6?
I want to get the emulated storage path. 我想获得模拟的存储路径。 System.getenv("EMULATED_STORAGE_TARGET")
works on previous versions ie Android 5 and below but returns null on Android 6. I searched on google but couldn't find anything. System.getenv("EMULATED_STORAGE_TARGET")
在System.getenv("EMULATED_STORAGE_TARGET")
版本(即Android 5及更低版本System.getenv("EMULATED_STORAGE_TARGET")
有效,但在Android 6上返回null。我在google上搜索但找不到任何内容。 How can I get the emulated storage path on Android 6. Any help will be appreciated. 如何在Android 6上获得模拟的存储路径。我们将不胜感激。 Thanks in advance!! 提前致谢!!
You appear to be referring to external storage , which on some versions of Android will be located at /storage/emulated/0/
. 您似乎是在指外部存储 ,在某些版本的Android上,该外部存储位于/storage/emulated/0/
。 The proper way to obtain the root of external storage, on all versions of Android, is by means of Environment.getExternalStorageDirectory()
. 在所有版本的Android上,获取外部存储根目录的正确方法是通过Environment.getExternalStorageDirectory()
。
If you find yourself using environment variables in an Android app, you are doing it wrong. 如果发现自己在Android应用程序中使用环境变量,则说明您做错了。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.