Sqlite issues with HTC Desire HD

Short answer: try removing SQLiteDatabase.OPEN_READONLY.

Longer answer:

The “WAL” is the write-ahead log, a relatively new feature in SQLite as I understand it. The SQLite docs on WAL say “It is not possible to open read-only WAL databases.” Now, that appears to be more in the context of read-only media, but it might hold true for OPEN_READONLY.

I’d be somewhat surprised if this helps, as it presumes that:

  • WAL is not used in standard Android
  • HTC enabled WAL in those two devices
  • Something special about your environment (e.g., the binary database you’re schlepping out of assets) is causing this problem where an ordinary read-only database still works fine, as I cannot imagine that those devices would have passed compatibility tests with broken read-only database support

But, I would think it is at least worth a shot.

You might also consider switching from packaging the binary database to packaging the SQL statements to build/populate the database and executing them. While this will be slower (much slower if you don’t use transactions), it might be less prone to database file-specific issues.

Leave a Comment