Native Activity question|suggestion? lazarus / 43-Android ---------------------------------------------------------------------- hinst · 2013-09-21 09:26 I am currently looking at this article: Quote from: http://wiki.lazarus.freepascal.org/Custom_Drawn_Interface/AndroidLCL- CustomDrawn-Android utilizes a minimal Java application which communicates with our Pascal library and sends all events to it and also obeys commands from it. The communication is done via JNI as supported by Google. The controls are not native, instead they are all drawing using TRawImage+TLazIntfImage+TLazCanvas and events and the painting are clipped using LazRegions. The drawing itself is done in Pascal using jnigraphics to draw on a Bitmap Java object which is then drawn by the minimal Java activity on a SurfaceView. And also at this article: Quote from: http://developer.android.com/reference/android/app/NativeA ctivity.htmlConvenience for implementing an activity that will be implemented purely in native code. That is, a game (or game-like thing). There is no need to derive from this class; you can simply declare it in your manifest, and use the NDK APIs from there.Maybe I'm missing something... but. Could it be that this Native Activity can be utilized to make development for Android significantly easier? The article on Lazarus Wiki (the one which I cited earlier in this post) implies that APK file should contain bot a native executable file (or dynamic library?) compiled by crossfpc-android-arm, and also a compiled java class (that is bytecode file). Which is (supposedly?) compiled by fpc-java (or how do I call this thing) compiler. HOwEvEr, if one was to utilize NativeActivity stuff from that article (the one I cited earlier; at developer.android.com), there would be no need for any java classes in the APK archive. It says "A very simple example of native code that is run by NativeActivity follows." and the following code is in C. This means (again, I am not sure, maybe I'm missing something) that activity can be implemented either in C; and then one could create bindings for FPC, or it could be implemented entirely in FPC. .........so there would be no need to mess with JAVA for those who want to develop android applications ---------------------------------------------------------------------- Leledumbo · 2013-09-21 15:05 QuoteThe article on Lazarus Wiki (the one which I cited earlier in this post) implies that APK file should contain bot a native executable file (or dynamic library?) compiled by crossfpc-android- armdynamic library, and yes with fpc arm-android. Quoteand also a compiled java class (that is bytecode file). Which is (supposedly?) compiled by fpc-java (or how do I call this thing) compiler.Nope, it's compiled with Java compiler (ATM, though it's certainly possible to compile with fpc jvm-android, but the class file will depend on jvm-android rtl). QuoteHOwEvEr, if one was to utilize NativeActivity stuff from that article (the one I cited earlier; at developer.android.com), there would be no need for any java classes in the APK archive. It says "A very simple example of native code that is run by NativeActivity follows." and the following code is in C. This means (again, I am not sure, maybe I'm missing something) that activity can be implemented either in C; and then one could create bindings for FPC, or it could be implemented entirely in FPC. .........so there would be no need to mess with JAVA for those who want to develop android applicationsThere's an effort with example already, it builds and works fine, just need a few adjustments in the compiler option (since I use different FPU support option). ---------------------------------------------------------------------- Seenkao · 2021-01-22 17:16 Quote from: Leledumbo on September 21, 2013, 05:05:23 pmThere's an effort with example already, it builds and works fine, just need a few adjustments in the compiler option (since I use different FPU support option). Thank you! The code works.