title: SD Card and Configuration Settings
body: <p>Oh Dear, Please help before I have no more hair on my head!</p>
  
  <p>Firstly, here is my code:</p>
  
  <pre><code>private void copyDatabase() {
      if(!Environment.MEDIA_MOUNTED.equals(Environment.getExternalStorageState())){ 
          Toast.makeText(this, "External SD card not mounted", Toast.LENGTH_LONG).show(); 
      } 
      //Toast Message Always appears
      try {
          InputStream in = getAssets().open("Asset_Directory");
  
  
          File outFile = new File(Environment.getExternalStorageDirectory() + File.separator + "Asset_Directory");
          outFile.createNewFile();
          OutputStream out = new FileOutputStream(outFile);
  
  
          byte[] buf = new byte[1024];
          int len;
          while ((len = in.read(buf)) &gt; 0) {
              out.write(buf, 0, len);
          }
  
          out.close();
          in.close();
          Log.i("AssetCaptureActivity","Database has been transferred");
      } catch (IOException e) {
          Log.i("AssetCaptureActivity","Could not open the file");
      }
  }`
  </code></pre>
  
  <p>As you can see:
  I copied a database file into my Assets folder. 
  Now I want to copy it to a virtual sd card so that I can edit the database.
  I have added the WRITE permissions in my manifest.
  I read that I need to change something in my [run configuration] setting - but what? </p>
  
  <p>I keep getting Permission Denied and It says my sd card is not mounted.</p>
  
  <p>Please help!</p>