As far as i know, i can use javax.microedition.io.file.FileConnection
for the required purpose. But i need an example.
Why i can't i use java.io.FileOutputStream
, and use this piece of code instead:
FileOutputStream fout;
try
{
// Open an output stream
fout = new FileOutputStream ("myfile.txt");
// Print a line of text
new PrintStream(fout).println ("I'm making an app on android!");
// Close our output stream
fout.close();
}
// Catches any error conditions
catch (IOException e)
{
System.err.println ("Unable to write to file");
System.exit(-1);
}
Please explain. Thanks