Sqlite questions lazarus / 43-Android ---------------------------------------------------------------------- CC · 2012-12-12 19:46 Felipe, I have seen you have been working on the sqlite part lately. I am planning to use  the virtual tables functionality  of Sqlite quite heavily . The implementations of the tables are in pascal.  Here are the questions: How to create the modules for android? For the GUI part it is still a question for me wether native code or the FPC java compiler is the faster way to get the project finished. ( I could use some advice in this regard too. ) In the later case earlier versions of Android could be targeted, but even then the VT modules would be better in native code if it is possible. Is v2.2 the lowest possible target version even when there is no GUI involved? In the first case maybe the best solution would be to compile sqlite into the app for speed and to avoid support problems. Is this a good idea? I know you are still at the beginning of the road to support sqlite and some of these may be a little more advanced question.  Cheers, CC ---------------------------------------------------------------------- Phil · 2012-12-12 19:52 If you code with FPC JVM, then you already have this access to the Android Sqlite Java package: http://developer.android.com/reference/android/database/sqlite/SQLiteD atabase.html See androidr.pas for the Pascal declarations for these methods. Also, an intro to FPC JVM development: http://web.fastermac.net/~MacPgmr/pba/PbaStatus.html Since mobile devices running iOS and Android already include the Sqlite library, my instinct would be the program against the API, rather than linking the library into your executable. Thanks. -Phil ---------------------------------------------------------------------- felipemdc · 2012-12-13 09:36 Quote from: Phil on December 12, 2012, 08:52:58 pmIf you code with FPC JVM, then you already have this access to the Android Sqlite Java package: http://developer.android.com/reference/android/database/sqlite/SQLiteD atabase.html And in native code you can access this class too, via JNI. Or how do you think that I wrote the sqlite support? ---------------------------------------------------------------------- felipemdc · 2012-12-13 09:44 Quote from: CC on December 12, 2012, 08:46:18 pmI am planning to use  the virtual tables functionality  of Sqlite quite heavily . The implementations of the tables are in pascal.  Here are the questions: How to create the modules for android? I don't know anything about sqlite virtual tables functionality, but in general, in Android you cannot access the sqlite native interface at the moment. The sqlite shared object exists, but it is not part of the NDK, so it is not allowed to use it. The only thing that we can use is the Java class that Phil mentioned, which in native code can be accessed via JNI: http://developer.android.com/reference/android/database/sqlite/SQLiteD atabase.html So it might be that VT modules are not supported by the libraries present in Android. One solution would be to ship your own sqlite.so library inside your project, and then you can access the native interface to it and use VT. QuoteIs v2.2 the lowest possible target version even when there is no GUI involved? Hard to tell, since I haven't written any no GUI Android project using the LCL ... I am sure that for the LCL drawing 2.2 is absolutely required. But if you are not using graphics, what for are you using the LCL? You can write a native JNI app without the LCL, using either the traditional method used by the LCL or the NativeApplication support in Android 2.3+ QuoteIn the first case maybe the best solution would be to compile sqlite into the app for speed and to avoid support problems. Is this a good idea? Yes, it is probably the only way to have VT tables working in your app. You will need to either compile your own sqlite.so or find a pre- compiled one. I already searched and a pre-compiled one a long time ago, but can't remember where it is now ... have to recheck this.