I tried a simple file write program in Android.
try
{
//File f1=new File("/sdcard/Prag.txt");
File f1=new File("J:\\Prag.txt");
BufferedWriter out = new BufferedWriter(new FileWriter(f1,true));
out.write("Pragadheesh" + "\n");
out.close();
} catch (IOException ioe)
{ioe.printStackTrace();}
But the exception is getting hit. How can I fix this?
[edit]:
I tried File f1=new File(Environment.getExternalStorageDirectory() + "//Prag.txt");
and f1 value = /mnt/sdcard/Prag.txt
But still the exception gets hit. I have changed the permission too in manifest file
[solution] As per Krishnabhadra's reply, I had to Make sure your SDCard is not mounted on a PC