Login  Register

Re: Recreating Jogl2 Android demo projects in Eclipse

Posted by zeno on Jul 25, 2016; 3:18pm
URL: https://forum.jogamp.org/Recreating-Jogl2-Android-demo-projects-in-Eclipse-tp4027079p4036956.html

Hello all,
seems like this thread is quite old, but I will still post my issue as a reply here because it is best related to this post. Yes, I am trying to run basic jogamp example (gears or redsquare) on android as mentioned in this thread, but I had to incorporate some ugly workarounds and tweaks to get it working.

So first some facts:
- using JOGL version 2.3.2 latest download.
- using real device with Android 5.1 Lollipop, 7" Lenovo Phablet.
- using latest 24.0.1 android build tools and have all sdk platforms installed. Target SDK is same as in examples.
- 64 bit openJDK of version 1.8.0_92
- installed all mentioned apk's via adb, almost all examples from test package WORK well.
- created the same android projects in several IDEs, added needed jar libraries from SAME jogamp package to build path.
- tweaked Manifest to respect my class names, either attached a copy of  LauncherUtil or used directly those from jogl-test package.
- tweaked launcher class parameters to run activity from my package, added shaders as assets (when needed).
- built without problems, until now all OK.
- penta-checked everything....

Debug tries:
- I can verify that "<uses-library>" tags should be removed, otherwise INSTALL_FAILED_MISSING_SHARED_LIBRARY really occurs.
- After manifest update came the final problem which I was not able to solve in "smooth" manner. Here is simple copy-paste from logcat (http://pastebin.com/raw/N7apxs3P), real errors are almost at the bottom, I hope it will help. Those errors varied a bit depending on used GLEventListener and/or individual class changes etc. but still in the same pipeline.
- After some time spent playing with this, I found out, that my simple program runs with imported LauncherUtil class removed while providing the original from jogl-test-android.jar package. I CHECKED several times and imported that LauncherUtil class code from the SAME downloaded archive.
- So, what I meant by non-smooth solution, I digged a bit more in this problem, and began to reduce contents of jogl-test-android.jar package manually (it is quite large on its own because of embedded fonts and other test cases).  So I came to final working solution, all packages/classes entries removed, only contents of com.jogamp.opengl.test.android and com.jogamp.opengl.test.junit.util classpaths were left untouched. Should I try and remove entries from those two left classpaths trying to leave there possibly only LauncherUtil and its internal classes, error was back. Here I stopped with my experimenting, because this is offcourse not a good way to go, yet jogl-test-android.jar is now < 100Kb and things work well. Seems to me like classes from this test package are imported somewhere by gluegen or jogl-all-android packages.
- Unfortunately I cannot debug my activity more properly, because jogamp launcher takes care of launching my Activity,...

I will gladly provide any further informations necesarry on your request and hope that someone of you with better insight into JOGL internals will grasp and catch up root cause of this problem.

Have a nice summer days...
Jan