Java – Replaces Android’s default sqlite build

Replaces Android’s default sqlite build… here is a solution to the problem.

Replaces Android’s default sqlite build

I want to replace Android’s default sqlite build feature with a new rtree. It looks like I have to use the java wrapper to do it, and the only thing I found compatible with Android is sqlite4java I prefer to stick to standards. Unfortunately, I found that dalvikvm (Android Virtual Machine) does not support jdbc, while native android.database.sqlite works with sqlite builds disabled by rtree.

Currently, I have a new .so sqlite rtree enabled library compiled for android, but want to replace Androids native without having to use a third-party wrapper like sqlite4java. Any ideas? I’m thinking of downloading the android.database.sqlite package from the android SDK and building a jar to replace only the .so load in my app context. Is this the best way to do it?

Solution

I was thinking about downloading android.database.sqlite package from android sdk and building a jar to substitute only the .so load withing my application context. Is that the best approach?

As long as you’re willing to refactor all the required classes into your own package, that’s probably the only way you can go. This is what SQLCipher for Android does, for example. They cloned ~37 classes from android.database and android.database.sqlite and modify them to build with their own SQLite that supports SQLCicher.

Related Problems and Solutions