Login  Register

Re: Recreating Jogl2 Android demo projects in Eclipse

Posted by asambol on Nov 21, 2012; 9:44am
URL: https://forum.jogamp.org/Recreating-Jogl2-Android-demo-projects-in-Eclipse-tp4027079p4027138.html

Update.

I tried with the NEWTGearsES2ActivityLauncher, which does extend LauncherUtil.BaseActivityLauncher, and it works!
Thanks again for your help.

So, if anyone ever wants to use Jogl2 in an Eclipse environment for Android, here is a short tutorial:

1. Install via adb or Google play the following packages (no need for the test package).
adb install gluegen-rt.apk
adb install jogl.all-android.apk
adb install jogl.android-launcher.apk

2. Create a new Android project in Eclipse, inside package my.package. Add the following classes (link) to your package:
LauncherUtil.java
NEWTGearsES2Activity.java - feel free to change name to YourActivity
   - change GearsES2 demo = new GearsES2(-1) to RedSquareES2 demo = new RedSquareES2(-1) or to your GLEventListener class
NEWTGearsES2ActivityLauncher.java - feel free to change name to YourActivityLauncher
RedSquareES2.java (from here)
   a) change String demo to "my.package.NEWTGearsES2Activity" (or YourActivity)
   b) change usr_pkgs to "my.package"

3. In java build path for that project, add:
gluegen-rt-android.jar
jogl-all-android.jar
(no need for native jars)

4. Create a folder named "shader" inside your "assets" folder, put RedSquareShader.fp and RedSquareShader.vp inside. (link)
   - here, I had a problem linking those shaders on my device, needed to add precision qualifiers on the beginning, no big deal - it worked after that

5. Your manifest should look like this: http://pastebin.com/R99iJ6Wc

After that, press launch on device and it should work.

The weird part here is that I had to remove the "<uses-library>" tags from manifest, otherwise it gave the above INSTALL_FAILED_MISSING_SHARED_LIBRARY error. Any thoughts on that?