Android SD card has no read/write permissions

Source: Internet
Author: User

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.

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.