I want to create folder in sdcard. i am using following command in android terminal
cd sdcard mkdir music
mkdir failed for music, Permission denied.
Try below code.It working fine.
you need to run emulator before run the below commands.
use the adb shell command from the android tools folder.
eg (this was on windows):
cd android-sdk-windows\tools
adb shell
cd /sdcard/
mkdir myfolder
Try below links for creating folder in sdcard
Create folder terminal window below link :
http://android-er.blogspot.in/2010/10/how-to-create-sub-folder-in-sd-card-of.html
Create folder in programmatically :
http://android-er.blogspot.in/2010/10/how-to-create-sub-folder-in-sd-card.html
Thanks..!
While creating a directory, it is better to provide complete path instead of using cd
Use Environment.getExternalStorageDirectory()
to get the storage root directory.
Use the following command to create directory:
String filepath=Environment.getExternalStorageDirectory()+"/Music"
File fc=new File(filepath)
if(!fc.exists())
fc.mkdir();
Make sure you have added SDCard support to your AVD.
Go to eclipse - windows - avd manager - select avd and edit - hardware - new - SDCard Support
And then Try the Command.