I have placed a file at /sdcard/Download/settings.json on an Android Virtual Device. I've verified the existence of this file use the Device File Explorer
as well as through ADB.
However, when I try to open/read this file I get the following error: java.io.FileNotFoundException: /sdcard/Download/settings.json (Permission denied)
I've put the following into the AndroidManifest.xml file:
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_INTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
A screenshot of the debug process is below:
Here is the view of the Device File Explorer
:
And here is the proof the file exists using ADB:
generic_x86:/sdcard/Download $ ls -lah
total 16K
drwxrwx--x 2 root sdcard_rw 4.0K 2019-09-10 11:17 .
drwxrwx--x 13 root sdcard_rw 4.0K 2019-09-03 14:13 ..
-rw-rw---- 1 root sdcard_rw 24K 2019-09-09 14:41 settings.json
generic_x86:/sdcard/Download $
- What do I need to do to be able to open/read this file on an Android Virtual Device?
- Do I somehow have to change the permissions on the file? I've tried
chmod
but it doesn't affect the file permissions.