Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
stockrt committed Jan 11, 2015
1 parent 46d0ae3 commit 0a17d27
Showing 1 changed file with 45 additions and 21 deletions.
66 changes: 45 additions & 21 deletions README.md
@@ -1,5 +1,27 @@
# 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/tools/sdk/ndk/index.html

## Update SQLite version if needed

* No download is necessary, Makefile will take care of that for you. Use the
Expand All @@ -17,56 +39,58 @@ http://www.sqlite.org/download.html
...
```

## 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 Native Code Applications for Android.

https://developer.android.com/tools/sdk/ndk/index.html

## Build

* Make the CLI and Shared Lib.
* Make CLI and Library

```bash
make clean
make

* Expected output
[armeabi] Compile thumb : sqlite3-cli <= shell.c
[armeabi] Compile thumb : sqlite3-cli <= sqlite3.c
[armeabi] Compile thumb : sqlite3 <= sqlite3.c

[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

[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
[armeabi] Install : sqlite3 => libs/armeabi/sqlite3
[armeabi] Executable : sqlite3-static
[armeabi] Install : sqlite3-static => libs/armeabi/sqlite3-static
```

## Artifacts

* CLI

```bash
libs/armeabi/sqlite3
libs/armeabi/sqlite3-static
libs/armeabi/sqlite3-dynamic
```

* Statically linked shared library
* Library

```bash
obj/local/armeabi/libsqlite3.a
libs/armeabi/libsqlite3.so
```

* You may now push SQLite CLI to your Android device
* You may now push SQLite to your Android device

```bash
adb push libs/armeabi/sqlite3 /sdcard/
adb push libs/armeabi/sqlite3-static /sdcard/sqlite3
adb shell
cp /sdcard/sqlite3 /data/local/
rm -f /sdcard/sqlite3
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 and environment.
Note that paths and permissions may vary in your Android device or environment.

Happy hacking.

0 comments on commit 0a17d27

Please sign in to comment.