title: copy database file to sdcard in android
body: <p>I am getting my database file by this code</p>
  
  <pre><code>  File dbFile=getDatabasePath("EdsysEyfsDB.db");
                 Log.v("database name checking", dbFile.toString());
  </code></pre>
  
  <p>I want to copy this database file to sdcard so I can do some operation for that. But I can't do any operation on that. The below code is using for copy to sd card</p>
  
  <pre><code>         if (dbFile.exists()) {
                         InputStream inStream = new FileInputStream(dbFile);
                         String file = Environment.getExternalStorageDirectory().getPath()
                              +"/" + "database.db";
                         Log.d("file name checking in  dbFilecondition", file);
                         FileOutputStream fs = new FileOutputStream(file);
                         byte[] buffer = new byte[1444];
                         while ((byteread = inStream.read(buffer)) != -1) {
                             bytesum += byteread;
                             fs.write(buffer, 0, byteread);
                         }
                         inStream.close();
                         fs.close();
                     }
  </code></pre>
  
  <p>But I am not going in this condition.The database file name is coming properly on LogCat. I already give permission for Read and Write file. </p>