android/sqlite: Cannot create Database in altered path
<p>I'm trying to create a database file in other location, but the app always failed to do so.</p>

<pre><code>        try {
        File sdcardfile = Environment.getExternalStorageDirectory();
        SQLiteDatabase db = SQLiteDatabase.openOrCreateDatabase(sdcardfile.getPath()+ "/test.db", null);
        System.out.println("Its open? "  + db.isOpen());

    } catch (Exception e) {
        tv.setText("error is "+e.toString());// tv is a text view
    }
</code></pre>

<p>I can create any database, as long as it doesn't use altered path.
It work fine if I use "test.db", but not if I use   "//test.db".</p>

<p>This is the logcat text:</p>

<pre><code>01-21 20:14:19.470: I/Database(3678): sqlite returned: error code = 14, msg = cannot open file at source line 25467
</code></pre>

<p>The Error it throws me is : <code>SQLite exception: unable to open database file.</code>
I use BlueStack as my emulator.</p>

<p>Thank you all for reading.         </p>

<p>Edited: my apps fails because it lacks WRITE PERMISSION... insert it and everything's ok.</p>
