Reputation: 197
I copy a file from USB to my SamSung S7 tablet using My Files app shipped with my tablet. I can find this file under /data using My Files app. I believe this file is stored in the shared external storage. As pointed in https://developer.android.com/training/data-storage
I need Android Storage Access Framework to access this file.
I want to access this file with my own app and I need to know the URL. What's the URL look like?
Thanks.
YL
Upvotes: 1
Views: 415
Reputation: 1814
A file URL looks like this in Android and you can use this type of URL to access files:
file:///path/to/foo.txt
file://
is used to refer to URL pointing to a world-readable file.getExternalFilesDir() or getExternalCacheDir() or getExternalMediaDirs()
. Hence, getExternalStorageDirectory
is deprecated and no longer recommended for use. (Read more here)WRITE_EXTERNAL_STORAGE
and READ_EXTERNAL_STORAGE
Let me know if you have any questions. Thanks.
Upvotes: 1