Create a folder on sdcard in Android, androidsdcard
// Create a folder on the SD card
Public void createSDCardDir (){
If (Environment. MEDIA_MOUNTED.equals (Environment. getExternalStorageState ())){
// Create a folder object and assign it to the directory of the External Storage
File sdcardDir = Environment. getExternalStorageDirectory ();
// Get a path with the folder path and name of the sdcard
String path = sdcardDir. getPath () + "/cardImages ";
File path1 = new File (path );
If (! Path1.exists ()){
// If the directory does not exist, you can create a directory when the application starts.
Path1.mkdirs ();
SetTitle ("paht OK, path:" + path );
}
}
Else {
SetTitle ("false ");
Return;
}
}
(To: http://blog.csdn.net/yun90/article/details/7611723)
Personal note: Create a built-in SDCard instead of an extended (external) SDCard
<! -- Write data to sdcard -->
<Uses-permission android: name = "android. permission. WRITE_EXTERNAL_STORAGE"> </uses-permission>
<! -- Create/delete object permissions in sdcard -->
<Uses-permission android: name = "android. permission. MOUNT_UNMOUNT_FILESYSTEMS"> </uses-permission>