Although the permission to read and write the SD card is stated in the manifest file,
However, you still do not have permission when running the program. This is because the SD card itself does not have permission, so you need to modify the permissions of the SD card.
First, let's take a look at the system situation before the permission is modified.
Modify ....
Use shell to modify its permissions
In command line mode
Adb shell // connect to the current mobile phone
Mount // view the permissions of the current File System
// Mount the remount file system. '/' indicates the root directory. Therefore, this is not only for sdcard, but also for other files. Rw indicates read and write permissions
Mount-o remount rw/
Su // switch to the root permission
Chmod 777/mnt/sdcard // key to modifying permissions. If you understand the linux permission concept, you will know why it is 7.
In this way, the modification is normal.
View the modified permissions.
Run the program again. Well, you can read and write files normally.