Well, this is not exactly a question, as I\'m not really \"stuck\" on my code, but I\'ve found some strange behavior for Android API regarding accessing the external storage
you're getting this error because you declare on the manifest.xml permission to write to the external storage. you need to add this permission.
also, do never ever ever ever write files (specially temporary ones) directly on the getExternalStorage().
This will put directly on the SD-card and will create a mess. For temporary files that is only to be seen by your own application you should use:
getExternalStorage() + "/Android/data//cache/"
replacing by your app packaged, e.g. com. Orabig.myFirstApp that special folder is automatically deleted from the system if the user uninstall the application, keeping the system free from temporary files.
edit:
Please note that my manifest does not include the
you have to!
edit: also, if you creating temporary media files (PNG for example) is good practice to create an empty file named .nomedia on that folder. That way you avoid the Media Scanner scanning it and showing it on the gallery.
last edit:
and before creating files you must create the folder by calling mkdirs()
on the File object.