Androidmanifest.xml whether to join the SDcard permission settings
<!--Create and delete file permissions--
<uses-permission android:name= "Android.permission.MOUNT_UNMOUNT_FILESYSTEMS"/>
<!--Write Data permissions--
<uses-permission android:name= "Android.permission.WRITE_EXTERNAL_STORAGE"/>
Solutions for Android SDcard read-only file system:
Also check your AVD virtual machine for the addition of SD card support!
=============
"Workaround"
A command in the CMD window is available:
ADB shell
Mount-o remount RW/
Other
How to move together let SDcard have read and write permission?
-------------------------------Other issues-----------------------------
To access SDcard in the program, you need to request permission to access SDcard.
The permissions to add access to SDcard in Androidmanifest.xml are as follows:
<!--Create and delete files in SDcard permissions--
<uses-permission android:name= "Android.permission.MOUNT_UNMOUNT_FILESYSTEMS"/>
<!--write data to sdcard permissions--
<uses-permission android:name= "Android.permission.WRITE_EXTERNAL_STORAGE"/>
-------------------------------more about the SDcard problem-------------------------
Why do I need sdcard
The download of images in Android will automatically find space for SDcard, SDcard is also very necessary in the development test.
1: How to load the SDcard in the simulator
The following examples are available through the documentation:
Mksdcard-l sdcard 100M sdcard.img//This will generate a sdcard image file in your PC in the tools directory.
Load SDcard when simulator is started
Emulator-sdcard SDCARD.IMG-AVD MYAVD2
This allows the emulator to see its own sdcard, which can be viewed via the ADB shell.
2: Traverse SDcard
How to find some special path in Android, such as SDcard this special path, actually just look at
Android.os.Environment This class is very clear, which has the following methods:
Getrootdirectory ();
Getdownloadcachedirectory ();
getExternalStorageDirectory ();
Getexternalstoragestate (); Each state of the current sdcard can be obtained.
With the path of the file, you can then use files for a variety of operations such as traversal.
Android SDcard's Read-only