I am working on a function to download an image from a web server, display it on the screen, and if the user wishes to keep the image, save it on the SD card in a certain fo
Make sure the directory is created before you call bitmap.compress:
bitmap.compress
new File(FileName.substring(0,FileName.lastIndexOf("/"))).mkdirs();