Forum > Android

creating openGL context in a unit whithout modifying the main program source

<< < (2/3) > >>

Key-Real:
The whole libraries including android_native_app_glue are in

lazarusSRC/lcl/interfaces/customdraw/android

TRon:
I do not have android target installed, hence why you are probably need to figure things out on your own.

The link I posted confirms my suspicion it still requires JAVA. Your native code (still) resides inside a library.

I do not really grasp why that is or would be a problem as all your code is running natively, it is only the the startup that is invoked from a JVM. How that looks at the native side depends on the wrapper being used. And you made your preferences clear so i can only suggest to replicate the wrappers to such an extend so that they meet your expectations/requirements.

I do not have any experience with custom drawn android controls but i do know there are people around here on the forum (probably absent for a while) that are able to tell you more about it.

Seenkao:
TRon, java не обязателен. Есть возможность в самом деле создавать абсолютно нативные приложения, без java-кода.

Key-Real, в тех каталогах должен быть полный нативный пример.
Но, я уже писал, по какой причине не стоит этим заниматься. Не было полностью всё реализовано всё для нативного исполнения. Даже внутренний цикл, надо переделывать. Очень многих функций не реализовано нативным методом. Многие функции приходится вызывать посредством jni - а это означает что всё равно приходится использовать java-код. Какую-то часть вы сможете реализовать, даже OpenGL. Но чем глубже вы будете погружаться, тем больше будет проблем.
Даже разработчики NDK не стали делать нормальных примеров для использования нативных методов.

Но сделать можно всё! Если вам захочется абсолютно всё сделать в нативном виде, то вам придётся переписывать драйвера с java-кода на Паскаль. И тестировать данные драйвера.
Если вы захотите использовать своё приложение для множества устройств, то вам придётся писать одни и те же драйвера для разных устройств. Потому что устройств тысячи. И драйвера выполняющие одни и те же функции на разных устройствах разные.
И только по этой причине все стараются реализовать через java-код. Потому что нет полной поддержки нативных методов реализации всех драйверов.

Так же вы можете посмотреть как это сделано в Castle Game Engine. И не забывайте про книги которые я скидывал. Там тоже показаны абсолютно нативные методы.

Я, когда делал полностью нативное приложение, использовал как примеры код C/C++.


Google translate:
TRon, java is optional. It is possible to actually create absolutely native applications, without java code.

Key-Real, there should be a full native example in those directories.
But, I already wrote, for what reason you should not do this. Everything was not fully implemented for native execution. Even the inner loop needs to be redone. A lot of functions are not implemented natively. Many functions have to be called via jni - which means that you still have to use java code. Some part you can implement, even OpenGL. But the deeper you go, the more problems there will be.
Even the NDK developers did not make normal examples for using native methods.

But everything can be done! If you want to do absolutely everything in a native form, then you will have to rewrite drivers from java code to Pascal. And test driver data.
If you want to use your application for multiple devices, then you will have to write the same drivers for different devices. Because there are thousands of devices. And the drivers that perform the same functions on different devices are different.
And for this reason alone, everyone is trying to implement through java code. Because there is no full support for native methods of implementing all drivers.

You can also see how it's done in the Castle Game Engine. And do not forget about the books that I threw off. It also shows absolutely native methods.

When I made a completely native application, I used C / C ++ code as examples.

DonAlfredo:
https://sourceforge.net/p/asphyre/code/HEAD/tree/trunk/Samples/FreePascal/Android/Basic/

Seenkao:
https://youtu.be/Vj3xPsK8kBU

В общем я нашёл видео, где делал полностью нативное приложение. Под самим видео выложен проект, что был сделан до меня. На видео я показываю как его можно собрать.

Google translate:
In general, I found a video where I made a completely native application. Under the video itself, there is a project that was made before me. In the video I show how to assemble it.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version