0

I'm using the following link in Android development:

http://developer.android.com/guide/topics/data/data-storage.html#filesInternal

with the following important code in my project:

String FILENAME = "hello_file";
String string = "hello world!";

FileOutputStream fos = openFileOutput(FILENAME, Context.MODE_PRIVATE);
fos.write(string.getBytes());
fos.close();

I couldn't seem to find the file "hello_file" anywhere on my computer, but when I ran the emulator in Eclipse, and then used DDMS (whatever that is) I was able to locate the file within the emulator...? This makes intuitive sense as the file would be outputted into the folders of a fully built app, not some Eclipse project folder- my question, really, is this- how do I go about opening and editing the file up- shouldn't there be a folder that contains the emulator's files in it? Through DDMS, I can see that "hello_file" exists, but I can't do anything with it...

Skorpius
  • 2,135
  • 2
  • 26
  • 31

1 Answers1

0

No. The file you write to internal storage is private as stated in the document.

You can save files directly on the device's internal storage. By default, files saved to the internal storage are private to your application and other applications cannot access them (nor can the user). When the user uninstalls your application, these files are removed.

The reason you can find the file in emulator because it is 'rooted' and can have access to all files in the file system. You cannot find this file on a real unrooted device.

wtsang02
  • 18,603
  • 10
  • 49
  • 67