Giter VIP home page Giter VIP logo

sqlite3-android's Introduction

SQLite build scripts for Android

This repository contains scripts to generate the following SQLite artifacts for Android:

  • Statically Linked CLI (sqlite3-static)
  • Dynamically Linked CLI (sqlite3-dynamic)
  • Static Library (libsqlite3.a)
  • Dynamically Linked Shared Object Library (libsqlite3.so)

The compilation generates, with a single command, binaries for the following ABIs (each in a separate folder): armeabi-v7a, arm64-v8a, x86, x86_64.

How to just download compiled binaries via Github Actions

This project is automatically compiled at each commit via the GitHub workflows contained in the .github folder. It is possible to download compiled artifacts via the Actions tab.

If the artifacts are no longer downloadable because it's been more than 90 days since the last commit, feel free to send a PR updating the sqlite version number, so that I can approve it and run the generation of the new artifacts.

You can also fork and manually start workflows in your repository.

How to update the sqlite version

Get the latest sqlite-amalgamation download link from the official sqlite download page. Extract year and version from it and put them into the Makefile as follows:

vi Makefile

...
SQLITE_VERSION ?= 3410200
SQLITE_YEAR    ?= 2023
...

It will take care to download and compile sources for you.

How to compile on your own

  • Install the 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.

  • Make CLI and Library:

    make clean
    make
  • Expected output:

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

Artifacts location

  • CLI:

    libs/armeabi-v7a/sqlite3-static
    libs/armeabi-v7a/sqlite3-dynamic
    ... (other ABIs also) ...
    
  • Library:

    obj/local/armeabi-v7a/libsqlite3.a
    libs/armeabi-v7a/libsqlite3.so
    ... (other ABIs also) ...
    

How to push sqlite to your Android device

Replacing armeabi-v7a with your needed ABI:

adb push libs/armeabi-v7a/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 jacopotediosi avatar stockrt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

wuhdafak zjw2017

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.