Hello, I recently started learning programming on Android, so I'm still fairly a beginner.
Anyway I'm trying to write a txt file on the Sd card and I can't figure out what might be wrong with my code, Eclipse doesnt seem to find any error, yet when I run the program, I dont seem to find "history.txt" on my SdCard.
try {
File root = Environment.getExternalStorageDirectory();
if (root.canWrite()) {
File f = new File(root, "history.txt");
FileWriter fw = new FileWriter(f);
BufferedWriter bw = new BufferedWriter(fw);
bw.write("data data data data data");
bw.close();
}
} catch (IOException e) {}