Latest SQLite binary for June 2015

Search This thread

tech128

Senior Member
Oct 14, 2012
177
118
Well I went through quite a few threads to find an updated, decent sqlite3 binary. Didn't find any that met that criteria.

So I compiled one.

Here's SQLite 3.8.11.1 combined into a single source file (the amalgamation) for ARM v6 and v7.

These binaries are built with optimized armv6 and armv7 flags.

Should work on Android 2.x and up.

I have attached 2 versions to this thread, compressed and uncompressed.
I had to change the extension to xap otherwise I can't upload it.
Just remove the extension.

Just download and run the uncompressed file, whereas compressed you have to uncompress it first.

Here's 2 alternative download links:

Compressed:


armv6

http://d-h.st/58Nn

armv6-nofpu

http://d-h.st/2ruo

armv7

http://d-h.st/UyJD

armv7-pie

http://d-h.st/xY2U



Uncompressed:


armv6

http://d-h.st/P5Im

armv6-nofpu

http://d-h.st/z0Ca

armv7

http://d-h.st/iiuF

armv7-pie

http://d-h.st/0Kp9

I now run 4 tests on the built binary.
1. I import the chinook test database using -init and dump it.
2. I open the already created sqlite database and dump it.
3. I vacuum the chinook database.
4. I reindex the chinook database.

Added 64bit file support, but it has not been fully tested.

Hopefully someone can do some tests with large five gigabyte data bases,
otherwise I'll get to it eventually.

Also, since I've actually made changes to the sqlite3 code since the update in January, I've created a github.
http://github.com/tech128/sqlite3
 

Attachments

  • sqlite3.armv6.xap
    840.6 KB · Views: 1,923
  • sqlite3.armv6-nofpu.xap
    844.6 KB · Views: 425
  • sqlite3.armv7.xap
    848.6 KB · Views: 2,331
  • sqlite3.armv7-pie.xap
    856.6 KB · Views: 1,380
  • sqlite3.armv6.7z
    345.4 KB · Views: 1,664
  • sqlite3.armv6-nofpu.7z
    346.5 KB · Views: 581
  • sqlite3.armv7.7z
    349.2 KB · Views: 4,462
  • sqlite3.armv7-pie.7z
    350.5 KB · Views: 2,856
Last edited:

E:V:A

Inactive Recognized Developer
Dec 6, 2011
1,447
2,222
-∇ϕ
Did someone test this on a Samsung? I'm asking because this binary is dynamically linked and thus dependent on libraries not being non-standard...
 

E:V:A

Inactive Recognized Developer
Dec 6, 2011
1,447
2,222
-∇ϕ
@tech128 If you want your sqlite3 to be device independent you have to make it statically linked. You current version does not work on my 4.2.2.
(It runs, but crashes as soon as you specify a db file, because of unmatched .so files.)
 

tech128

Senior Member
Oct 14, 2012
177
118
@tech128 If you want your sqlite3 to be device independent you have to make it statically linked. You current version does not work on my 4.2.2.
(It runs, but crashes as soon as you specify a db file, because of unmatched .so files.)

@E:V:A

It is a honor to have you post in my thread. Thank you for letting me know it does not work on your system.

I have read many of your threads, extremely informative. One day I hope to memorize all of what you have written.

I compiled sqlite3 dynamically because it is a little easier on the memory subsystem and has a smaller output filesize.

I tested it on several android 2.3 / 4.3 / 4.4 systems and they all seemed to work fine so I thought it would be ok.

Especially since all that is dynamically referenced is libc and libdl.

I have just compiled a static version but I need to test it before posting it.

I will update the op soon.
 

tech128

Senior Member
Oct 14, 2012
177
118
your sqlite3 can reindex, but it can not vaccum. u can re-check it

@kien_vip

Thank you for letting me know about this issue.

I test sqlite before I release it, but there are no test suites for it, barring one which requires tcl, which I have no desire to compile since there's no other use for it.

The current sqlite can probably only reliably work with databases up to 2 or 4 GB

Which usually isn't a problem since most sqlite databases are well under that amount.

I've been trying to compile an updated sqlite with proper 64 bit file support.

Since 64 bit file support is a bit wonky on android, this has been a bit tough.

Also, I've been rather busy since I last released the binary, so I haven't had much time to think about compiling in general.

I'll do my best to get a new binary out soon-ish.
 

phangs23

Member
Mar 22, 2011
44
6
How do I use this? please help, I'm doing a research on how to speed up an application that uses sqlite database. Right now, this is one option.
 

tech128

Senior Member
Oct 14, 2012
177
118
Armv6 flags? So it's useless on Nexus 4/5 etc with armv7 CPUs? Can we find one which is optimised for high end devices?

No not useless, just less than optimal. Not really sure of the speedup, since I don't do benchmarks. I try to optimize it as much as possible without breaking it x_X

I was initially planning to put out both armv6 and armv7 ports at the same time, but then I realized most android utilities aren't compiled with proper 64bit file support.

So I've been trying to figure that out first. And also, most people don't use sqlite for anything earth-shattering anyway, mostly vacuum, reindex, create database from sql statements, etc.

Oooooo just saw this while searching for sqlite performance enhancements. https://sqlite.org/src4/doc/trunk/www/design.wiki

Very nice.

I'd also like to try to switch to musl as the standard library since alireza7991 has said it makes things smaller and faster. Not sure how feasible that will end up for me though...

It doesn't look like sqlite can parallelized at all though. See here: http://blogs.perl.org/users/timm_murray/2013/02/sqlite-and-writes.html

There is a fork/variant of sqlite called paralite that uses threading, but I don't think it retains the same file format compatibility and it looks like it introduces some bugs.

Unfortunately real life stuff takes precedence so things will progress slower than I would like. But at least I know there's lots to look forward to even just for sqlite lol.
 

nanobrain

Member
Aug 12, 2010
7
0
Will it work on L?

My current sqlite3 binary won't work on Lollipop because it needs to be a PIE (position independent executable) and so far I haven't been able to find one compiled that way. Is yours?

Thanks
 

maττ

Member
Dec 4, 2012
25
11
My current sqlite3 binary won't work on Lollipop because it needs to be a PIE (position independent executable) and so far I haven't been able to find one compiled that way. Is yours?

Thanks

I'll attach one that I have working for me. You'll need to extract the zip and then place sqlite3 in /system/xbin and then you should be able to call your sqlite3 similar (if not the same) as you did before.
 

Attachments

  • sqlite3.zip
    209.1 KB · Views: 2,832

tdunham

Inactive Recognized Contributor
Jun 21, 2008
13,686
36,465
TampaBay
I'll attach one that I have working for me. You'll need to extract the zip and then place sqlite3 in /system/xbin and then you should be able to call your sqlite3 similar (if not the same) as you did before.
This SQLite seems to be Android L (5.0) compatible on the Galaxy S5.
I appreciate the upload as well. I was getting the PIE errors too when trying to verify sql scripts were running.
 

maττ

Member
Dec 4, 2012
25
11

eyesfortech

Senior Member
Nov 10, 2011
72
32
www.eyes4tech.com
Thanks for this, I am one of those enthusiasts who focuses on tweaking my phone and I am currently testing your version of sqlite3 on my MT6582 devices.

On my script, your version of sqlite3 is working like a charm... I will still observe.

Here's a snippet of my defrag script.

Database /data/data/com.android.dialer/databases/dialer.db: VACUUM=SUCCESS REINDEX=SUCCESS
Database /data/data/com.android.providers.downloads/databases/downloads.db: VACUUM=SUCCESS REINDEX=SUCCESS
Database /data/data/com.google.android.gms/databases/upload_queue.db: VACUUM=SUCCESS REINDEX=SUCCESS
Database /data/data/com.google.android.gms/databases/google_analytics.db: VACUUM=SUCCESS REINDEX=SUCCESS
Database /data/data/com.google.android.gms/databases/plus.db: VACUUM=SUCCESS REINDEX=SUCCESS
Database /data/data/com.google.android.gms/databases/node.db: VACUUM=SUCCESS REINDEX=SUCCESS
Database /data/data/com.google.android.gms/databases/gcore_ulr_UlrLocation.db: VACUUM=SUCCESS REINDEX=SUCCESS
Database /data/data/com.google.android.gms/databases/gcore_ulr_ActivityDetection.db: VACUUM=SUCCESS REINDEX=SUCCESS
Database /data/data/com.google.android.gms/databases/gcore_ulr_ApiMetadata.db: VACUUM=SUCCESS REINDEX=SUCCESS
Database /data/data/com.google.android.gms/databases/keys.db: VACUUM=SUCCESS REINDEX=SUCCESS
Database /data/data/com.google.android.gms/databases/ns.db: VACUUM=SUCCESS REINDEX=SUCCESS
Database /data/data/com.google.android.gms/databases/rmq.db: VACUUM=SUCCESS REINDEX=SUCCESS
Database /data/data/com.google.android.gms/databases/playlog.db: VACUUM=SUCCESS REINDEX=SUCCESS
Database /data/data/com.google.android.gms/databases/gcm_registrar.db: VACUUM=SUCCESS REINDEX=SUCCESS
Database /data/data/com.google.android.gms/databases/peoplelog.db: VACUUM=SUCCESS REINDEX=SUCCESS
Database /data/data/com.google.android.gms/databases/pluscontacts.db: VACUUM=SUCCESS REINDEX=SUCCESS
Database /data/data/com.google.android.gms/databases/connectionconfig.db: VACUUM=SUCCESS REINDEX=SUCCESS
Database /data/data/com.google.android.gms/databases/google_account_history.db: VACUUM=SUCCESS REINDEX=SUCCESS
Database /data/data/com.google.android.gms/databases/dg.db: VACUUM=SUCCESS REINDEX=SUCCESS
 
  • Like
Reactions: blackhawk1819

eng.ahmed.android

Senior Member
Dec 11, 2013
67
23
What is sqlite binary?

I am an android developer and using sqlite database but i didn't hear before about sqlite binary!
Could you please explain me what is this ?

Thanks in advance :)
 

Top Liked Posts

  • There are no posts matching your filters.
  • 33
    Well I went through quite a few threads to find an updated, decent sqlite3 binary. Didn't find any that met that criteria.

    So I compiled one.

    Here's SQLite 3.8.11.1 combined into a single source file (the amalgamation) for ARM v6 and v7.

    These binaries are built with optimized armv6 and armv7 flags.

    Should work on Android 2.x and up.

    I have attached 2 versions to this thread, compressed and uncompressed.
    I had to change the extension to xap otherwise I can't upload it.
    Just remove the extension.

    Just download and run the uncompressed file, whereas compressed you have to uncompress it first.

    Here's 2 alternative download links:

    Compressed:


    armv6

    http://d-h.st/58Nn

    armv6-nofpu

    http://d-h.st/2ruo

    armv7

    http://d-h.st/UyJD

    armv7-pie

    http://d-h.st/xY2U



    Uncompressed:


    armv6

    http://d-h.st/P5Im

    armv6-nofpu

    http://d-h.st/z0Ca

    armv7

    http://d-h.st/iiuF

    armv7-pie

    http://d-h.st/0Kp9

    I now run 4 tests on the built binary.
    1. I import the chinook test database using -init and dump it.
    2. I open the already created sqlite database and dump it.
    3. I vacuum the chinook database.
    4. I reindex the chinook database.

    Added 64bit file support, but it has not been fully tested.

    Hopefully someone can do some tests with large five gigabyte data bases,
    otherwise I'll get to it eventually.

    Also, since I've actually made changes to the sqlite3 code since the update in January, I've created a github.
    http://github.com/tech128/sqlite3
    9
    My current sqlite3 binary won't work on Lollipop because it needs to be a PIE (position independent executable) and so far I haven't been able to find one compiled that way. Is yours?

    Thanks

    I'll attach one that I have working for me. You'll need to extract the zip and then place sqlite3 in /system/xbin and then you should be able to call your sqlite3 similar (if not the same) as you did before.
    8
    Hi all, here is the archive of compiled binaries of the latest snapshot 201606031859 of SQLite for the next architectures:
    1. armeabi
    2. armeabi-v7a
    3. arm64-v8a
    4. mips
    5. mips64
    6. x86
    7. x86_64
    All binaries was compiled with PIE support. Archive includes:
    • sqlite3-static
    • sqlite3-dynamic
    • libsqlite3.so
    for each architecture.

    You can download it here - sqlite-snapshot-201606031859-binaries-all-abi.7z. Also i was write a small guide how to compile SQLite using Windows PC and Android NDK, it's here. Initially it's in russian, but you can use Google Translate to read it.
    6
    New binary!

    UPDATE: Just compiled this using latest stable source (3.21.0). Compiled static, includes readline support.

    Command line used, if anyone's interested (on a Debian 9 box):
    Code:
    arm-linux-gnueabihf-gcc-6 -march=armv7 -pipe -pie -I. -DSQLITE_THREADSAFE=0 -DSQLITE_ENABLE_EXPLAIN_COMMENTS=1 -DYYSTACKDEPTH=0 -DHAVE_READLINE=1 $( ncursesw5-config --cflags ) -fno-strict-aliasing -O3 -L. -Wl,--no-as-needed -Wl,--no-dynamic-linker *.c -static -ldl -lreadline -lhistory $( ncursesw5-config --cflags ) -s -o sqlite3-3.21.0-armv7
    6
    So I finally managed to update Sqlite after 5 months.

    I am the busiest person I know, always trying to do a million things.

    I rarely will drop a project, and when I do, I always leave some kind of explanation ( Just in case people wonder if the project is dead, etc )