Android program writes to emulator but not phone
<p>I am trying to write an Android program to accept input and then write the data to a file on the internal storage of my phone. When I execute my program on the emulator it makes a file just as I expect it to, but when I try and execute it on my phone the file doesn't seem to be created. I've looked around on this site and I can't seem to find a solution to my problem anywhere (a few similar ones, but nothing that worked for me) I was hoping you guys might be able to offer me advice on what I'm doing wrong.</p>

<pre><code>FileOutputStream fos = null;
String x = "Sample String";
    try{
            fos = openFileOutput("answers.txt", MODE_PRIVATE);
            fos.write(x.getBytes());

        } catch (IOException e) {
            e.printStackTrace();
        }    

    try {
           fos.close();
         } catch (IOException e) {
            e.printStackTrace();
    }
</code></pre>

<p>On the emulator, I can find the file in DDMS at "data/data/com.example.helloandroid/files/answers.txt". On the phone, if I try to open up the data folder in DDMS it shows it is an empty directory. I have already added in this line to my manifest:</p>

<pre><code>&lt;uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /&gt;
</code></pre>

<p>I cannot seem to think of anything else that I could be doing wrong. Thanks in advance for the help, it is appreciated.</p>
