I\'ve been pulling out my hair on this for a while now. The following method is supposed to download a file, and save it to the location specified on the hard drive.
<
Further to Kevin Day's reply, there is another failure modality that previous posts did not mention. It is that even if you have android.permission.WRITE_EXTERNAL_STORAGE in your manifest, if you are trying to write to media such as /mnt/sdcard that is mounted externally as a USB gadget (i.e. you connected your device as an external disk to your PC with a USB cable) at the time you are trying to do the write, then you can't write to the /mnt/sdcard file system. In this case FILE.mkdir will return false. Obviously, if you are not checking the return code you wont see this problem until you get an IOException if you try to create a file in the directory that you think that you created. And if you don't create a file in this non-existent directory then the app will just silently fail.
I make this mistake constantly when debugging Android apps - forget that I can't both have the sdcard mounted externally and at the same time have my app write to it.