I’m developing a simple application for Android devices.
I need to create a directory, but I can’t do it.
File folder = new File(Environment.getExternalStorageDirectory ()+"/dir");
if(folder.mkdirs()){
CrearToast("Directorio creado"); //successfully created
}else{
CrearToast("fallo"); // error creating directory
}
*CrearToast creates a toast with the text in brackets.
I have set
uses-permission android:name=”android.permission.WRITE_EXTERNAL_STORAGE”
are you trying to write on SD card or phone memory??
Have you looked at this??
http://developer.android.com/guide/topics/data/data-storage.html
EDIT:
This is how i create my folders
SD card directory: