Skip to content Skip to sidebar Skip to footer

Missing Table In Sqlite With Specific Version Of Htc Desire Hd

My application has a SQLite database in the asset folder. When the user launches my application, the database is created and the tables too. This works fine with a lot of devices (

Solution 1:

This is a bit of a guess and would imply there is a 'bug' in that version of Android for the Desire HD so I may be wildly out.

I'm wondering if that version of Android doesn't create the database where it should do. You're assuming that DB_PATH is \data\data\packagename\databases\ as it normally would be but what if it isn't? The result would be the following...

  1. this.getReadableDatabase() would create an empty database at \some\incorrect\path\mydatabase
  2. Using new FileOutputStream(outFileName) simply creates a new empty binary file because the above didn't create a database at the place you expect.
  3. The copy happens successfully
  4. Before performing the SELECT request, access to the database is requested using either getReadableDatabase() or getWriteableDatabase() but both of those will simply open the empty database that was created in Step 1.

In short, the copy process may well have worked correctly but the DB that is being operated on is empty and in a different place to where you expect it.

Just an idea (I've seen similar things happen over the years).

Post a Comment for "Missing Table In Sqlite With Specific Version Of Htc Desire Hd"