Forum > Other OS

Newbie questions about cross-compile and android apk's

<< < (2/3) > >>

Handoko:

--- Quote from: cpicanco on May 19, 2017, 04:40:15 am ---2) If yes, how. If no, what should I do to end up with an apk??

--- End quote ---

If you want to build Android apk files, here are some reading materials:

http://forum.lazarus.freepascal.org/index.php/topic,33487.0.html
http://forum.lazarus.freepascal.org/index.php/topic,32472.msg209447.html
http://forum.lazarus.freepascal.org/index.php/topic,32489.msg209647.html
http://forum.lazarus.freepascal.org/index.php/topic,33428.msg216672.html#msg216672
http://forum.lazarus.freepascal.org/index.php/topic,28908.0.html
https://github.com/jmpessoa/lazandroidmodulewizard
http://forum.lazarus.freepascal.org/index.php/board,56.0.html

In short:
There are many ways available to use Lazarus/FPC to build Android apk. You should try to find which one works for you, especially these: LAMW, LazToAPK, Pandroid. LAMW probably is the best, it is well maintained, has lots of ready to use components, has no problem with Android 5+ Intel targets.

cpicanco:
Thank you so much guys, I will take a look!

cpicanco:
May I ask if it is possible to completely avoid java code (expect for the jdk and ndk stuff)? Many example projects, including the LCL example itself, has a bunch of java code. I would love a 100% free pascal alternative to build apps/apks. I am pretty sure I am missing the overall strategy here. If would appreciate if someone could explain what is happening here. Is it some sort of pascal binding for the java api? Or the other way around?

Leledumbo:

--- Quote from: cpicanco on May 21, 2017, 07:30:56 pm ---May I ask if it is possible to completely avoid java code (expect for the jdk and ndk stuff)? Many example projects, including the LCL example itself, has a bunch of java code. I would love a 100% free pascal alternative to build apps/apks. I am pretty sure I am missing the overall strategy here. If would appreciate if someone could explain what is happening here. Is it some sort of pascal binding for the java api? Or the other way around?

--- End quote ---
Yes, by using NativeActivity. This is however, is meant for you-draw-everything-yourself apps, like games. In other words, you don't get access to android GUI libraries, draw everything yourself using OpenGL ES. Another way is to use FPC JVM, but I consider this as separate environment, it's like coding Java using Pascal syntax. The amount of code you can reuse with this method is considerably low.

All existing approaches use the same base and recommended way to access Java code from other languages: JNI. But instead of directly interface with Android libraries, another wrapper is made for possibly unbounded reasons: ease of use, componentization (to make it more similar to LCL, thus allowing form designer to be used), etc. that will be harder to do if the interface is plainly done. You can check the Java code yourself, as it's normally only 2 small files (one for bootstrapping as required by Android runtime if you want to use its GUI libraries, another one for wrapping functionalities to make it simpler and easier to use).

jmpessoa:

Hello cpicanco!

As LAMW user,  you do not need code  Java or "Pascal JNI  hieroglyphs" code... just plain Pascal!

Please, go to to

https://github.com/jmpessoa/lazandroidmodulewizard/blob/master/readme_get_start.txt

Any questions or needs we are here to help you!

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version