[問題] Android 6.0 存取External Storage

作者: magic704226 (梅姬?沒雞?傻傻分不清楚)   2016-10-31 17:41:07
網路上看到一段話
"In Android 6.0, any device that is not adopted is considered portable.
[…] Third-party apps must go through the Storage Access Framework to
interact with files on portable storage; direct access is explicitly
blocked for privacy and security reasons."
我的需求是
目前Android 6.0
External Storage 接上之後
我要用Application存取
是否無法達到
我接了一個usb和sd card
分別
/storage/3635-6336
/storage/3962-6336
上面兩個路徑都無法讀寫
p.s.
Environment.getExternalStorageDirectory()
為 /storage/emulated/0
這可以正常存取,因為是Internal Storage 模擬出來的
作者: shoaming (修明)   2016-10-31 21:14:00
https://goo.gl/57O4eg,參考一下。

Links booklink

Contact Us: admin [ a t ] ucptt.com