I've got file named plik
in assets
folder. My sqlhelper has a method called databaseExist()
:
public boolean databaseExist()
{
System.out.println(DB_PATH + DB_NAME);
File dbFile = new File(DB_PATH + DB_NAME);
return dbFile.exists();
}
My package name is:
package pl.mobiledietplanner;
Path and name is set as:
private static String DB_PATH = "/data/data/pl.mobiledietplanner/databases/";
private static String DB_NAME = "plik";
In the activity I invoke this method:
MyDBHelper helper = new MyDBHelper(this);
System.out.println(helper.databaseExist());
The result is:
/data/data/pl.mobiledietplanner/databases/plik
false
I've done everything as described on the blog.
Could anyone tell me what I did wrong?
EDIT:
I also opened File Explorer
as said here and added <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
. But the data
folder is empty.