summaryrefslogtreecommitdiffstats
path: root/src/android
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2011-09-30 15:01:38 +0200
committerSven Gothel <[email protected]>2011-09-30 15:01:38 +0200
commitcdc99f97fde9211b7f73d8592d3d64c6ec78898a (patch)
tree029e27acd01c924af772ea649725966968bae451 /src/android
parentdf6021f9ef50623e6ac8f0822e827fd31a0a0cf2 (diff)
Android Launcher Demos: Adept to df6021f9ef50623e6ac8f0822e827fd31a0a0cf2
Diffstat (limited to 'src/android')
-rw-r--r--src/android/com/jogamp/android/launcher/NEWTLauncherActivity.java30
-rw-r--r--src/android/com/jogamp/android/launcher/NEWTLauncherGearsES1Activity.java8
-rw-r--r--src/android/com/jogamp/android/launcher/NEWTLauncherGearsES2Activity.java8
-rw-r--r--src/android/com/jogamp/android/launcher/NEWTLauncherGraphUIActivity.java8
4 files changed, 43 insertions, 11 deletions
diff --git a/src/android/com/jogamp/android/launcher/NEWTLauncherActivity.java b/src/android/com/jogamp/android/launcher/NEWTLauncherActivity.java
index 02ec1ea68..81bc26572 100644
--- a/src/android/com/jogamp/android/launcher/NEWTLauncherActivity.java
+++ b/src/android/com/jogamp/android/launcher/NEWTLauncherActivity.java
@@ -33,6 +33,8 @@ import java.lang.reflect.Method;
import android.app.Activity;
import android.os.Bundle;
+import android.view.Window;
+import android.view.WindowManager;
import android.widget.TextView;
import android.util.Log;
@@ -44,7 +46,8 @@ public abstract class NEWTLauncherActivity extends Activity {
Class<?> activityClazz = null;
Object activityObject = null;
- public abstract String getDownstreamActivityName();
+ public abstract String getUserActivityName();
+ public abstract String getUserPackageName();
@Override
public void onCreate(Bundle savedInstanceState) {
@@ -53,20 +56,23 @@ public abstract class NEWTLauncherActivity extends Activity {
// System.setProperty("nativewindow.debug", "all");
// System.setProperty("jogl.debug", "all");
+ System.setProperty("jogl.debug.GLProfile", "true");
+ System.setProperty("jogl.debug.GLDrawable", "true");
// System.setProperty("newt.debug", "all");
System.setProperty("newt.debug.Window", "true");
// System.setProperty("newt.debug.Window.MouseEvent", "true");
// System.setProperty("newt.debug.Window.KeyEvent", "true");
// System.setProperty("jogamp.debug.IOUtil", "true");
- // System.setProperty("jogamp.debug.JNILibLoader", "true");
- // System.setProperty("jogamp.debug.NativeLibrary", "true");
+ System.setProperty("jogamp.debug.JNILibLoader", "true");
+ System.setProperty("jogamp.debug.NativeLibrary", "true");
// System.setProperty("jogamp.debug.NativeLibrary.Lookup", "true");
System.setProperty("jogl.debug.GLSLCode", "true");
+ System.setProperty("nativewindow.debug.GraphicsConfiguration", "true");
- ClassLoader cl = ClassLoaderUtil.createJogampClassLoaderSingleton(this);
+ ClassLoader cl = ClassLoaderUtil.createJogampClassLoaderSingleton(this, getUserPackageName());
if(null != cl) {
try {
- activityClazz = Class.forName(getDownstreamActivityName(), true, cl);
+ activityClazz = Class.forName(getUserActivityName(), true, cl);
Log.d(TAG, "Activity Clazz "+activityClazz);
activityObject = createInstance(activityClazz, null);
Log.d(TAG, "Activity Object "+activityObject);
@@ -91,6 +97,12 @@ public abstract class NEWTLauncherActivity extends Activity {
Log.d(TAG, "error: "+e, e);
throw e;
}
+
+ // Make window fullscreen
+ requestWindowFeature(Window.FEATURE_NO_TITLE);
+ getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
+ WindowManager.LayoutParams.FLAG_FULLSCREEN);
+
callMethod(activityObject, mSetIsInvokedByExternalActivity, this);
callMethod(activityObject, mOnCreate, savedInstanceState);
@@ -142,9 +154,17 @@ public abstract class NEWTLauncherActivity extends Activity {
Log.d(TAG, "onDestroy - S");
callMethod(activityObject, mOnDestroy);
super.onDestroy();
+ finish();
Log.d(TAG, "onDestroy - X");
}
+ @Override
+ public void finish() {
+ Log.d(TAG, "finish - S");
+ super.finish();
+ Log.d(TAG, "finish - X");
+ }
+
/**
* @throws JogampRuntimeException if the instance can not be created.
*/
diff --git a/src/android/com/jogamp/android/launcher/NEWTLauncherGearsES1Activity.java b/src/android/com/jogamp/android/launcher/NEWTLauncherGearsES1Activity.java
index bc179eb9f..05b47544b 100644
--- a/src/android/com/jogamp/android/launcher/NEWTLauncherGearsES1Activity.java
+++ b/src/android/com/jogamp/android/launcher/NEWTLauncherGearsES1Activity.java
@@ -2,10 +2,14 @@ package com.jogamp.android.launcher;
public class NEWTLauncherGearsES1Activity extends NEWTLauncherActivity {
static String demo = "com.jogamp.opengl.test.android.NEWTGearsES1Activity";
+ static String pkg = "com.jogamp.opengl.test";
@Override
- public String getDownstreamActivityName() {
+ public String getUserActivityName() {
return demo;
}
-
+ @Override
+ public String getUserPackageName() {
+ return pkg;
+ }
}
diff --git a/src/android/com/jogamp/android/launcher/NEWTLauncherGearsES2Activity.java b/src/android/com/jogamp/android/launcher/NEWTLauncherGearsES2Activity.java
index 170d1b5a7..78f2b7411 100644
--- a/src/android/com/jogamp/android/launcher/NEWTLauncherGearsES2Activity.java
+++ b/src/android/com/jogamp/android/launcher/NEWTLauncherGearsES2Activity.java
@@ -2,10 +2,14 @@ package com.jogamp.android.launcher;
public class NEWTLauncherGearsES2Activity extends NEWTLauncherActivity {
static String demo = "com.jogamp.opengl.test.android.NEWTGearsES2Activity";
+ static String pkg = "com.jogamp.opengl.test";
@Override
- public String getDownstreamActivityName() {
+ public String getUserActivityName() {
return demo;
}
-
+ @Override
+ public String getUserPackageName() {
+ return pkg;
+ }
}
diff --git a/src/android/com/jogamp/android/launcher/NEWTLauncherGraphUIActivity.java b/src/android/com/jogamp/android/launcher/NEWTLauncherGraphUIActivity.java
index e1bab1e70..6a185fecc 100644
--- a/src/android/com/jogamp/android/launcher/NEWTLauncherGraphUIActivity.java
+++ b/src/android/com/jogamp/android/launcher/NEWTLauncherGraphUIActivity.java
@@ -2,10 +2,14 @@ package com.jogamp.android.launcher;
public class NEWTLauncherGraphUIActivity extends NEWTLauncherActivity {
static String demo = "com.jogamp.opengl.test.android.NEWTGraphUIActivity";
+ static String pkg = "com.jogamp.opengl.test";
@Override
- public String getDownstreamActivityName() {
+ public String getUserActivityName() {
return demo;
}
-
+ @Override
+ public String getUserPackageName() {
+ return pkg;
+ }
}