• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Writing Text to internal Storage

markbarr

Lurker
Guys

Excuse my ignorance nut im prettyy new to this

Im trying to write a string to a text file on the phone internal storage

i use the following code

protected void writefile() {
String FILENAME = "filedemo.txt";
String content = txtMessage.getText().toString();

try {
FileOutputStream fos = openFileOutput(FILENAME,MODE_PRIVATE);
fos.write(content.getBytes());
fos.close();
Toast.makeText(this, "File Saved",Toast.LENGTH_SHORT).show();
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}}

I understand this writes it to the internal storage in data/data but I want it to store in a folder called "Datafiles" which I can access via my PC or using a file manager

any ideas how i do this?

Your help greatly appreciated

Mark
 
Hi markbarr, and welcome to Android Forums! :D

I've moved your question to our Application Development thread, where our resident developers hang out and exchange ideas. Hopefully someone will be able to help out with your question soon. :)
 
Back
Top Bottom