I'm studying this source http://rootserver.rosseaux.net/stuff/BeRoXMAndroidSrc.zip,
use method 1, is not it? What is the best according to you?
Yes, it uses method 1.
I think it is very hard to compare them, because they are so different. In short:
method 1>
* Cannot access Android APIs from Pascal, if you want to use them it needs to be done in Java
* Requires knowledge of Java and the JNI to program. You actually need to write part of the program in Java.
* Existing Pascal applications will require extensive modifications to work in this method. Only non-GUI code can be reused
* It more like Google wants you to program, so maybe more stable
method 2>
* Allows using the Android APIs in Pascal
* You can build Android apps without any Java knowledge. The Java helper app is just a machine controlled by your Pascal code, you can just copy it to your programs and modify only the name of the main file.
* Makes it feasable to port Pascal applications with minimal modifications. With this method the LCL can be ported for example and LCL programs recompiled for Android, or else you can write your GUI directly using the Android APIs in Pascal.
* My current Java machine is not very optimized, so it will probably be slow for very large programs. It can be optimized in the future, however.
Both allow writing non-GUI code in Pascal.
Note that in both cases there are two ways to build the GUI:
* Write the GUI using Android APIs -> In this case the Java-only GUI in method 1 will probably be faster, because the bindings introduce a delay, but it is probably negletible, because this isn't a bottleneck. But I don't care much, since I much prefer writing in Pascal rather then Java =)
* Write the GUI using OpenGL ES -> In this case both are equivalent, although all the other points above apply