I have sqlite db, which I copied to the asset folder. In my program, I check if the database exists if I do not create a new one and copy it. I used (more or less) the code from http://www.reigndesign.com/blog/using-your-own-sqlite-database-in-android-applications/comment-page-2/
public void createDataBase() throws IOException { boolean dbExist = checkDataBase(); if (dbExist) { Log.i(DEBUG_TAG, "createDataBase -> Datenbank existiert");
In the emulator, it works fine.
I tried to run it on my device (HTC Desire HD). There I get the following message:
03-26 17:02:05.053: INFO/Database(24458): sqlite returned: error code = 14, msg = cannot open file at line 27206 of [42537b6056]
This happens when I first try to open a database. When I run the Program in the emulator, I do not receive this message. When I run the program a second time, it finds a database, no errors with opening, but tables do not exist.
I debugged the program several times on the emulator and device, but did not find any solution.
Could this be a resolution problem? (Since I also cannot see db on a device with adb -> denied 'permission)
I am very new to android, so maybe I just missed something stupid.
thanks
source share