The Android file store goes to the SD card to write file path error problem solver.

Source: Internet
Author: User

============ Problem Description ============


Because learning needs to look at the old Luo's video about the data stored in the SD card to write the part of the file to almost completely comply with the knock code results on the pad test and expected to have a difference originally should be stored in the SD card file results ran to the pad to bring in memory go ... And then I tried to write the path directly to myself or to my own memory. Why is that? By the way, spit out the wicked mentor. 11 we have to work overtime.
Ask the Great God guide Ah ~ National Day Play the school yo!!!

============ Solution 1============


Perhaps the system default SD card path is self-carrying memory? Each phone's SD card is dependent on the model, and I remember to change the default SD card path on the/etc/vold.fstab.

============ Solution 2============


Do you get the path with Environment.getexternalstoragedirectory ()?
Normal.

============ Solution 3============


You can directly try to generate files in the SD card path, I tried to be successful.
File File = new file ("/mnt/sdcard/test.log"); FileOutputStream out = new FileOutputStream (file), Out.write ("This is a test". GetBytes ()); Out.close ();

The Android file store goes to the SD card to write file path error problem solver.

Related Article

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.