Giter VIP home page Giter VIP logo

sqlite3-android's Introduction

SQLite build scripts for Android

This build scripts generate the following SQLite artifacts for Android:

  • Statically Linked CLI

    • sqlite3-static
  • Static Library

    • libsqlite3.a
  • Dynamically Linked CLI

    • sqlite3-dynamic
  • Dynamically Linked Shared Object Library

    • libsqlite3.so

Configure your environment

  • Get Android NDK and configure your environment so the command ndk-build can be found in the PATH. This is a build dependency and is necessary to cross-compile and build Android Native Code Applications:

https://developer.android.com/ndk/downloads/index.html

Update SQLite version if needed

  • No download is necessary, Makefile will take care of that for you. Use the download link only to choose any sqlite-amalgamation version number and year:

http://www.sqlite.org/download.html

  • Update Makefile with desired SQLite version and corresponding year. This will be used to build the full download URL from SQLite site.
  vi Makefile

  ...
  SQLITE_VERSION ?= 3160100
  SQLITE_YEAR    ?= 2017
  ...

Build/Compile

  • Make CLI and Library
  make clean
  make

  * Expected output

  [armeabi] Compile thumb  : sqlite3-static-cli <= shell.c
  [armeabi] Compile thumb  : sqlite3-static-cli <= sqlite3.c
  [armeabi] Compile thumb  : sqlite3-a <= sqlite3.c
  [armeabi] StaticLibrary  : libsqlite3.a
  [armeabi] Executable     : sqlite3-static
  [armeabi] Install        : sqlite3-static => libs/armeabi/sqlite3-static

  [armeabi] Compile thumb  : sqlite3-dynamic-cli <= shell.c
  [armeabi] Compile thumb  : sqlite3-dynamic-cli <= sqlite3.c
  [armeabi] Compile thumb  : sqlite3-so <= sqlite3.c
  [armeabi] SharedLibrary  : libsqlite3.so
  [armeabi] Executable     : sqlite3-dynamic
  [armeabi] Install        : sqlite3-dynamic => libs/armeabi/sqlite3-dynamic
  [armeabi] Install        : libsqlite3.so => libs/armeabi/libsqlite3.so

Artifacts

  • CLI
  libs/armeabi/sqlite3-static
  libs/armeabi/sqlite3-dynamic
  • Library
  obj/local/armeabi/libsqlite3.a
  libs/armeabi/libsqlite3.so
  • You may now push SQLite to your Android device
  adb push libs/armeabi/sqlite3-static /sdcard/sqlite3
  adb shell
  mv /sdcard/sqlite3 /data/local/
  chmod 755 /data/local/sqlite3
  /data/local/sqlite3 -help

Note that paths and permissions may vary in your Android device or environment.

Happy hacking!

sqlite3-android's People

Contributors

codezjx avatar fabianfrank avatar stockrt avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.