title: How to create/write file in the root of the Android device?
body: <p>I found out that you can use something like this to create a file:</p>
  
  <pre><code>FileOutputStream  fs = openFileOutput("/test.in", MODE_WORLD_WRITEABLE);
  String s = "[Head]\r\n";
  s += "Type=2";
  byte[] buffer = s.getBytes();
  fs.write(buffer);
  fs.close();
  </code></pre>
  
  <p>When running the above code I get an IllegalArgumentException stating: </p>
  
  <blockquote>
    <p>java.lang.IllegalArgumentException:
    File /test.in contains a path
    separator</p>
  </blockquote>
  
  <p>and I'm guessing the "/" is not appreciated. I wanted the "/" since I need to write the file to the root directory of the device, as stated in the API in trying to follow:</p>
  
  <blockquote>
    <p>A request is a textfile (UNICODE) with
    the file extension ".in". The
    application reads and parses the .in
    file when it's placed in root
    directory on the mobile device.</p>
  </blockquote>
  
  <p>Question is: how do I place a file in the root-directory? I have been looking around for an answer, but haven't found one yet.</p>