This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
yap-6.3/packages/swig/android/jni/sqlite/README
Vítor Santos Costa e918226918 SQLite for android
2014-07-15 18:57:48 -05:00

41 lines
1.7 KiB
Plaintext

All the files in this directory are copied from stock android. The following
files:
JniConstants.cpp
JNIHelp.cpp
ALog-priv.h
are copied in from Android's libnativehelper module (altogether less than 1000
lines of code). The remainder are from the core framework (directory
/frameworks/base/core/jni).
Notes on changes:
The ashmem_XXX() interfaces are used for the various "xxxForBlobDescriptor()"
API functions. The code in libcutils for this seems to be platform
dependent - some platforms have kernel support, others have a user space
implementation. So these functions are not supported for now.
The original SQLiteConnection.cpp uses AndroidRuntime::genJNIEnv() to obtain a
pointer to the current threads environment. Changed to store a pointer to the
process JavaVM (Android allows only one) as a global variable. Then retrieve
the JNIEnv as needed using GetEnv().
Replaced uses of class String8 with std::string in SQLiteConnection.cpp and a
few other places.
The stock Android code to populate CursorWindow containers with the results of
a SELECT statement uses a C++ interface that is not available to NDK builds. So
this code is rewritten to call the CursorWindow java interface via JNI methods.
This is the largest source code change. See function
nativeExecuteForCursorWindow() in file android_database_SQLiteConnection.cpp
for details.
The "LOCALIZED" collation and some miscellaneous user-functions added by the
sqlite3_android.cpp module are not included. A collation called LOCALIZED
that is equivalent to BINARY is added instead to keep various things working.
This should not cause serious problems - class SQLiteConnection always
runs "REINDEX LOCALIZED" immediately after opening a connection.