try{ File root = new File(Environment.getExternalStorageDirectory(), "Notes"); if (!root.exists()) { root.mkdirs(); } File gpxfile = new File(root, "mytimer1.txt"); FileWriter writer = new FileWriter(gpxfile); String STRINGTOFILE="this is to be written"; writer.append(STRINGTOFILE); writer.flush(); writer.close(); Toast.makeText(getBaseContext(), "File saved successfully!", Toast.LENGTH_SHORT).show(); } catch (java.io.IOException e){ }