title: Copy file from system storage(/data/data...) to external storage
body: <p>I want to copy a file from /data/data... to the external SDCARD! However, i'm finding this problem:
  Log message: 04-04 12:01:19.271: DEBUG/Carburant(9623): /username.usercar.settings.dat (No such file or directory)</p>
  
  <p>I guess that i can't simply access to this file without an "extra" code.
  Here is my code(the necessary lines):</p>
  
  <pre><code>File sdCard = Environment.getExternalStorageDirectory();
      File dir = new File (sdCard.getAbsolutePath() + "/Carburant/");
      dir.mkdirs();
      copyfile(nom,sdCard.getAbsolutePath() + "/Carburant/storeddata.dat");
  
  public Import(Context context,String nom) {
          this.context = context;
          this.nom=nom;
         }
  </code></pre>
  
  <p>The lines where the function is called:</p>
  
  <pre><code>case R.id.exporter:
              final SharedPreferences preferences = PreferenceManager
              .getDefaultSharedPreferences(context);
      String fileName = getResources().getString(R.string.fileName);
      fileDir = "" + preferences.getString("login", "") + "."+ preferences.getString("marque", "") + ".";
      Import myImport = new Import(this,fileDir+fileName);
              myImport.transfer();
              return true;
  </code></pre>
  
  <p>Android Manifest(necessary code):</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
        package="carburant.android.com"
        android:versionCode="1" android:versionName="0.1"&gt;
      &lt;uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /&gt;
      &lt;uses-sdk android:minSdkVersion="8" /&gt;
  </code></pre>
  
  <p>Copy file func:</p>
  
  <pre><code>private void copyfile(String srFile, String dtFile){
          try{
              File f1 = new File(srFile);
              File f2 = new File(dtFile);
            InputStream in = new FileInputStream(f1);
            OutputStream out = new FileOutputStream(f2);
  
            byte[] buf = new byte[4096];
            int len;
            while ((len = in.read(buf)) &gt; 0){
              out.write(buf, 0, len);
            }
            in.close();
            out.close();
            Toast.makeText(context, "Export effectué", Toast.LENGTH_SHORT).show();
          }
          catch(FileNotFoundException ex){
              Toast.makeText(context, "File Not found", Toast.LENGTH_SHORT).show();
              String x=ex.getMessage();
              Log.d("Carburant", x);
          }
          catch(IOException e){
              Toast.makeText(context, "Echec", Toast.LENGTH_SHORT).show();      
          }
        }
  </code></pre>
  
  <p>So, what misses? 
  Thanks.</p>