How to create Folder on External Memory in Android.
public boolean isExternalStorageWritable()
{
if (Environment.MEDIA_MOUNTED.equals(Environment
if (Environment.MEDIA_MOUNTED.equals(Environment
.getExternalStorageState()))
return true;
else
return false;
}
File folder;
if (isExternalStorageWritable()) {
dbFolder = new File(
Environment.getExternalStorageDirectory()
+
File.separator + "Mohammad");
}
boolean success
= false;
if (!dbFolder.exists()) {
success = dbFolder.mkdir();//one directory
// success = dbFolder.mkdir(); to create more than one directory
// like "Mohammad/kaied/abuhmead"
// success = dbFolder.mkdir(); to create more than one directory
// like "Mohammad/kaied/abuhmead"
}
if (!success) {
DB_DIRE=null;
}
No comments:
Post a Comment