Search code examples
androidunity3d-2dtools

Connection with SQLLite on Unity3D using Javascript in Android


How can connect with SQLLite from Android using Unit3D and Javascript?

Someone can'i help me?


Solution

  • Here are the specific steps to getting SQLite set up in your project.

    1. Download SQLite - you'll want the ZIP file with the DLL inside that's in the Precompiled Binaries for Windows section.
    2. Important Copy sqlite3.dll into your into your project's Plugins folder (make a folder called Plugins if you don't have one).
      1. You won't get a warning if you don't do this, and your project will run fine in the editor, however, it will fail to work when you actually build your project, and will only provide information about this in the log file.
      2. This will give you a License Error if you're using Unity Indie, but it doesn't seem to have an effect on the actual play in the editor, nor does it seem to effect the ability to build stand-alone versions.
      3. Alternately, you can leave it out of your project entirely, but when you build your application, you'll need to include a copy of sqlite3.dll in the same directory as the .exe in order for it to work.
    3. In your project, add in the dbAccess.js file: http://wiki.unity3d.com/index.php/SQLite#dbAccess.js
    4. You should be good to go!

    Source (and the above is pretty much copied word-for-word from): http://wiki.unity3d.com/index.php/SQLite