A: 

After

File outputfile = new File(file, filename);

Insert this:

outputfile.createNewFile();
Blumer
Now it gives IOException, parent directory of file does not exist. But I can see the parent directory created in the sd card ah? Why?
Wen
Ok, I've made a very stupid mistake. I defined the filename in a wrong manner. I put "/" in the filename and that is not accepted. After deleting it everything works fine now. :)
Wen
A: 

Have you enabled the right permissions in the Android Manifest? i.e. android.permission.WRITE_EXTERNAL_STORAGE. I was getting the same FileNotFoundException when trying to save to SD before adding the permission.

antonyt
Ya, I added that.
Wen
It's the filename problem.
Wen