Sqlite plugin for Android


I am trying to get sqlite working on Android. I have a Mobile license for Android and I am developing on a Macbook Pro. Here is my plan of attack:

  1. Download sqlite from sqlite.org;
  2. Compile sqlite.so and copy it into Plugins/Android
  3. Wrap around sqlite.so with C#
  4. Use it in Javascript or C# elsewhere in my application

The only problem is I am self trained in computer and compiling is not exactly my strong point. I once compiled a shared library using Android NDK and thought this would be similar. Not at all. And the plugin example from Unity site (the one with the texture) came with the DLL already made so it doesn’t help.

Could someone post a detailed direction on how to accomplish this. Or, if you have a better solution, please do share.


OK, correct me if I am wrong. Mono allows linux-based systems to run dll files?

I am following the example from unifycommunity.com It works in the editor and on Mac standalone, but it does not work for Android.

After unzipping the apk file, I see a Mono.Data.Sqlite.dll file under the Managed/ folder. When I tried to create a database through my app on a Droid, I got the following error from ddms:

07-15 13:27:33.550: INFO/Unity(31157): DllNotFoundException: sqlite3
07-15 13:27:33.550: INFO/Unity(31157): at (wrapper managed-to-native) Mono.Data.Sqlite.UnsafeNativeMethods:sqlite3_open_ v2 (byte,intptr&,int,intptr)
07-15 13:27:33.550: INFO/Unity(31157): at Mono.Data.Sqlite.SQLite3.Open (System.String strFilename, SQLiteOpenFlagsEnum flags, Int32 maxPoolSize, Boolean usePool) [0x00000] in :0
07-15 13:27:33.550: INFO/Unity(31157): at Mono.Data.Sqlite.SqliteConnection.Open () [0x00000] in :0

Could anyone tell me what is going on?

Some forum user kindly posted a Shared Object Library version of the sqlite3.dll, so it can work on Android. Here : http://forum.unity3d.com/threads/97043-Sqlite-for-Android-help-please?p=686204#13

Solved everything for me.

Please, check this → SQLiteKit | Integration | Unity Asset Store
That is 100% managed code, full SQLite3 support, all platforms.
No native dependencies.

I wish to hell I could down vote this answer. definitely not helpful in the least.