title: copy database from assets to databases folder
body: <p>In main activity I have this method which copies files from <code>assets</code> to the <code>databases</code> folder: </p>
  
  <pre><code>try{
      // CHECK IS EXISTS OR NOT
      SQLiteDatabase dbe = SQLiteDatabase.openDatabase("/data/data/com.henanet.dalel/databases/mydb.sqlite",null, 0);
      dbe.close();
      // COPY IF NOT EXISTS
      AssetManager am = getApplicationContext().getAssets();
      OutputStream os = new FileOutputStream("/data/data/com.henanet.dalel/databases/mydb.sqlite");
      byte[] b = new byte[100];
      int r;
      InputStream is = am.open("mydb.sqlite");
      while ((r = is.read(b)) != -1) {
          os.write(b, 0, r);
      }
      is.close();
      os.close();
  }
  catch(Exception e)
  {
  
  }
  </code></pre>
  
  <p>But once the user installs the app, he gets this error in LogCat:</p>
  
  <pre><code>09-14 22:57:25.694: I/Database(19903): sqlite returned: error code = 14, msg = cannot               open file at source line 25467
  09-14 22:57:25.694: E/Database(19903): sqlite3_open_v2("/data/data/com.henanet.dalel/databases/mydb.sqlite", &amp;handle, 2, NULL) failed
  </code></pre>