title: How do I write a byte array to a file in Android?
body: <p>This is my code to create a file.</p>
  
  <pre><code>public void writeToFile(byte[] array) 
  { 
      try 
      { 
          String path = "/data/data/lalallalaa.txt"; 
          FileOutputStream stream = new FileOutputStream(path); 
          stream.write(array); 
      } catch (FileNotFoundException e1) 
      { 
          e1.printStackTrace(); 
      } 
  } 
  </code></pre>
  
  <p>When I try to send my file to my server by just calling the path <code>String path = "/data/data/lalallalaa.txt";</code></p>
  
  <p>I get this logcat error message:</p>
  
  <pre><code>03-26 18:59:37.205: W/System.err(325): java.io.FileNotFoundException: /data/data/lalallalaa.txt
  </code></pre>
  
  <p>I don't understand why it can't find a file that is "supposedly" created already.</p>