title: Write to a file in SD Card in Android
body: <p>I tried a simple file write program in Android.</p>
  
  <pre><code> 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();}
  </code></pre>
  
  <p>But the exception is getting hit. How can I fix this?</p>
  
  <p>[edit]:
  I tried <code>File f1=new File(Environment.getExternalStorageDirectory() + "//Prag.txt");</code>
  and f1 value = /mnt/sdcard/Prag.txt
  But still the exception gets hit. I have changed the permission too in manifest file</p>
  
  <p>[solution]
  As per Krishnabhadra's reply, I had to Make sure your SDCard is not mounted on a PC</p>