This is based on the implementation from https://www.sqlite.org/android, which is equal to the AOSP implementation besides not depending private Android APIs. The code has been rewritten from C++ to C.