title: Android copy database from internal to external storage
body: <p>I'm trying to copy my existing databases from my Internal to External Storage,but I have a little problem. It says that <code>the file does not exist</code>. Here is what I'm using actually :</p>
  
  <p>to copy files from internal to external storage :</p>
  
  <pre><code>    private void copyFile(String src, String dst) throws IOException{
      FileChannel inChannel = new FileInputStream(src).getChannel();
      FileChannel outChannel = new FileOutputStream(dst).getChannel();
      try
      {
          inChannel.transferTo(0, inChannel.size(), outChannel);
      }
      finally
      {
          if (inChannel != null)
              inChannel.close();
          if (outChannel != null)
              outChannel.close();
      }
  }
  </code></pre>
  
  <p>and I'm using it like this : </p>
  
  <pre><code>copyFile("/data/data/com.example.test/databases/database.sqlite","/sdcard/.Example/Data/database.sqlite");
  </code></pre>
  
  <p>but it's not working and I'm pretty sure that the database in internal storage is there.</p>
  
  <p>If I set as a destination folder in <code>copyFile</code> <code>"/sdcard/.Example/Data/"</code> it's creating file <code>Data</code> in <code>.Example</code>.</p>
  
  <p>Any suggestions what I'm missing?</p>