goaman
goaman

Reputation: 87

Where does Android save your files?

I'm using the basic android developers code to write a file to the Android system, but I'm not sure where the app is saving my file. Where can I check on my phone to make sure the file is being written and saved correctly.

Here's the code:

protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    try {
        outputStream = openFileOutput(filename, Context.MODE_PRIVATE);
        outputStream.write(string.getBytes());
        outputStream.close();
    } catch (Exception e) {
        e.printStackTrace();
    }
}

Upvotes: 1

Views: 278

Answers (1)

ObieMD5
ObieMD5

Reputation: 2657

It creates a file under /data/data/your.package.name/<name you specify for file> like you just named it test.txt it would be /data/data/your.package.name/test.txt

Upvotes: 1

Related Questions