From 0cfc7847c58b51c9a26b50d905b592d1fc4c8578 Mon Sep 17 00:00:00 2001
From: Sven Gothel <sgothel@jausoft.com>
Date: Wed, 14 Mar 2012 23:07:21 +0100
Subject: Android: New ActivityLauncher (jogamp.android-launcher.apk)

ActivityLauncher provides delegating Activities, allowing the user to:

  - daisy chain custom APK classes and native libraries to the classpath

  - name one custom activity which gets delegated to, the downstream activity

Overview:

  [User:a1] -- (usr-data) --> [Launcher] -> [User:a2] + using [other packages..]

[User APK]   - The user provided APK
[JogAmp APK] - JogAmp APKs

[User:a1]    - The initial user activity, which starts the [Launcher].
               Providing data to [Launcher]: [User:a2], [User APK]
               Resides in [User APK]

[User:a2]    - The actual downstream 'real' activity, spoiled w/ full fledged ClassLoader
               having access to all packages as requested, ie. [User APK], ..
               Resides in [User APK]

[Launcher]   - The launcher activity.
               Gets called by [User:a1].
               Creates a new ClassLoader, daisy chainging all requested APKs.
               Instantiates [User:a2] w/ new ClassLoader.
               Delegates all calls to [User:a2].
               Resides in [JogAmp APK].
---
 .../android/AndroidManifest-CompileTime.xml        | 26 -----------
 .../resources/android/AndroidManifest-Launcher.xml | 54 ++++++++++++++++++++++
 make/resources/android/AndroidManifest-Runtime.xml |  4 +-
 make/resources/android/AndroidManifest-Test.xml    |  4 +-
 make/resources/android/res/values/colors.xml       |  6 +++
 make/resources/android/res/values/strings.xml      | 10 +++-
 make/resources/android/res/values/styles.xml       | 20 ++++++++
 7 files changed, 92 insertions(+), 32 deletions(-)
 delete mode 100644 make/resources/android/AndroidManifest-CompileTime.xml
 create mode 100644 make/resources/android/AndroidManifest-Launcher.xml
 create mode 100644 make/resources/android/res/values/colors.xml
 create mode 100644 make/resources/android/res/values/styles.xml

(limited to 'make/resources/android')

diff --git a/make/resources/android/AndroidManifest-CompileTime.xml b/make/resources/android/AndroidManifest-CompileTime.xml
deleted file mode 100644
index 331457b..0000000
--- a/make/resources/android/AndroidManifest-CompileTime.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
-      sharedUserId="com.jogamp.Community" 
-      package="com.jogamp.gluegen">
-
-    <uses-sdk android:minSdkVersion="9" />
-
-    <application android:icon="@drawable/icon" 
-                 android:label="@string/app_name"
-                 android:description="@string/app_descr"
-                 android:persistent="false"
-                 >
-        <activity android:name="jogamp.common.os.android.GluegenVersionActivity"
-                  android:finishOnTaskLaunch="true"
-                  android:launchMode="singleTop"
-                  android:label="@string/activity_v_name"
-                  android:description="@string/activity_v_descr"
-                  >
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <category android:name="android.intent.category.LAUNCHER" />
-            </intent-filter>
-        </activity>
-    </application>
-
-</manifest>
diff --git a/make/resources/android/AndroidManifest-Launcher.xml b/make/resources/android/AndroidManifest-Launcher.xml
new file mode 100644
index 0000000..ab0825c
--- /dev/null
+++ b/make/resources/android/AndroidManifest-Launcher.xml
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+      sharedUserId="com.jogamp.Community" 
+      package="jogamp.android.launcher">
+
+    <uses-permission android:name="android.permission.INTERNET" /> <!-- required for NV's perfhud -->
+    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <!-- required for Android trace -->
+
+    <uses-sdk android:minSdkVersion="9" />
+
+    <application android:icon="@drawable/icon" 
+                 android:label="@string/app_launcher_name"
+                 android:description="@string/app_launcher_descr"
+                 android:persistent="false"
+                 >
+        <activity android:name="jogamp.android.launcher.ActivityLauncher"
+                  android:finishOnTaskLaunch="false"
+                  android:launchMode="standard"
+                  android:configChanges="keyboardHidden|orientation|screenLayout"
+                  android:label="@string/activity_l_name"
+                  android:description="@string/activity_l_descr"
+                  android:exported="true"
+                  >
+                  <!-- android:configChanges="keyboardHidden|orientation|screenLayout|screenSize" -->
+            <intent-filter>
+                <action android:name="org.jogamp.launcher.action.LAUNCH_ACTIVITY_NORMAL" />
+                <category android:name="android.intent.category.DEFAULT" />
+                <data android:scheme="launch" android:host="jogamp.org"/>
+            </intent-filter>
+        </activity>
+        <activity android:name="jogamp.android.launcher.ActivityLauncher"
+                  android:finishOnTaskLaunch="false"
+                  android:launchMode="standard"
+                  android:configChanges="keyboardHidden|orientation|screenLayout"
+                  android:label="@string/activity_l_name"
+                  android:description="@string/activity_l_descr"
+                  android:exported="true"
+                  android:theme="@style/Theme.Transparent"
+                  >
+                  <!--
+                  android:configChanges="keyboardHidden|orientation|screenLayout|screenSize" 
+                  android:theme="@style/Theme.Transparent"
+                  android:theme="@android:style/Theme_NoDisplay"
+                  android:theme="@android:style/Theme.Translucent"
+                  -->
+            <intent-filter>
+                <action android:name="org.jogamp.launcher.action.LAUNCH_ACTIVITY_TRANSPARENT" />
+                <category android:name="android.intent.category.DEFAULT" />
+                <data android:scheme="launch" android:host="jogamp.org"/>
+            </intent-filter>
+        </activity>
+    </application>
+
+</manifest>
diff --git a/make/resources/android/AndroidManifest-Runtime.xml b/make/resources/android/AndroidManifest-Runtime.xml
index 04dfe33..7f165f8 100644
--- a/make/resources/android/AndroidManifest-Runtime.xml
+++ b/make/resources/android/AndroidManifest-Runtime.xml
@@ -6,8 +6,8 @@
     <uses-sdk android:minSdkVersion="9" />
 
     <application android:icon="@drawable/icon" 
-                 android:label="@string/app_name"
-                 android:description="@string/app_descr"
+                 android:label="@string/app_runtime_name"
+                 android:description="@string/app_runtime_descr"
                  android:persistent="false"
                  >
         <activity android:name="jogamp.common.os.android.GluegenVersionActivity"
diff --git a/make/resources/android/AndroidManifest-Test.xml b/make/resources/android/AndroidManifest-Test.xml
index 1b713be..6aec2f4 100644
--- a/make/resources/android/AndroidManifest-Test.xml
+++ b/make/resources/android/AndroidManifest-Test.xml
@@ -7,8 +7,8 @@
     <uses-library android:name="com.jogamp.common" android:required="true" />
 
     <application android:icon="@drawable/icon" 
-                 android:label="@string/app_name"
-                 android:description="@string/app_descr"
+                 android:label="@string/app_test_name"
+                 android:description="@string/app_test_descr"
                  android:persistent="false"
                  >
         <activity android:name="jogamp.common.os.android.GluegenVersionActivity"
diff --git a/make/resources/android/res/values/colors.xml b/make/resources/android/res/values/colors.xml
new file mode 100644
index 0000000..f4d188b
--- /dev/null
+++ b/make/resources/android/res/values/colors.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+	<drawable name="screen_background_black">#ff000000</drawable>
+    <drawable name="translucent_background">#e0000000</drawable>
+    <drawable name="transparent_background">#00000000</drawable>
+</resources>
diff --git a/make/resources/android/res/values/strings.xml b/make/resources/android/res/values/strings.xml
index f6a6fe4..207583f 100644
--- a/make/resources/android/res/values/strings.xml
+++ b/make/resources/android/res/values/strings.xml
@@ -1,8 +1,14 @@
 <?xml version="1.0" encoding="utf-8"?>
 <resources>
     <string name="hello">GlueGen Activity is Greeting You.</string>
-    <string name="app_name">JogAmp\'s GlueGen Library</string>
-    <string name="app_descr">Contains Dalvik and native code, supporting native bindings.</string>
+    <string name="app_launcher_name">JogAmp\'s Launcher</string>
+    <string name="app_launcher_descr">Provides daisy chained classloader and Activity delegation.</string>
+    <string name="app_runtime_name">JogAmp\'s GlueGen Library</string>
+    <string name="app_runtime_descr">Contains Dalvik and native code, supporting native bindings.</string>
+    <string name="app_test_name">JogAmp\'s GlueGen Tests</string>
+    <string name="app_test_descr">GlueGen tests.</string>
     <string name="activity_v_name">GlueGen\'s Version</string>
     <string name="activity_v_descr">Shows the version of the GlueGen Library.</string>
+    <string name="activity_l_name">JogAmp Launcher</string>
+    <string name="activity_l_descr">Launches an arbitrary user Activity class file, utilizing daisy chaining.</string>
 </resources>
diff --git a/make/resources/android/res/values/styles.xml b/make/resources/android/res/values/styles.xml
new file mode 100644
index 0000000..5b7eb7e
--- /dev/null
+++ b/make/resources/android/res/values/styles.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+    <style name="Theme" parent="android:Theme">
+    </style>
+
+    <style name="Theme.Translucent" parent="android:style/Theme.Translucent">
+        <item name="android:windowBackground">@drawable/translucent_background</item>
+        <item name="android:windowNoTitle">true</item>
+        <item name="android:colorForeground">#fff</item>
+    </style>
+
+    <style name="Theme.Transparent">
+        <item name="android:windowIsTranslucent">true</item>
+        <item name="android:windowAnimationStyle">@android:style/Animation.Translucent</item>
+        <item name="android:windowBackground">@drawable/transparent_background</item>
+        <item name="android:windowNoTitle">true</item>
+        <item name="android:colorForeground">#fff</item>
+    </style>
+
+</resources>
-- 
cgit v1.2.3