diff options
author | Sven Gothel <[email protected]> | 2012-03-14 23:07:21 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2012-03-14 23:07:21 +0100 |
commit | 0cfc7847c58b51c9a26b50d905b592d1fc4c8578 (patch) | |
tree | 2764affabade9825b3e1b13035632b4934e3a690 /make | |
parent | eedb4b530fb83fc59a26962bcf7847a1404092a0 (diff) |
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].
Diffstat (limited to 'make')
-rw-r--r-- | make/build-test.xml | 2 | ||||
-rw-r--r-- | make/build.xml | 85 | ||||
-rw-r--r-- | make/resources/android/AndroidManifest-CompileTime.xml | 26 | ||||
-rw-r--r-- | make/resources/android/AndroidManifest-Launcher.xml | 54 | ||||
-rw-r--r-- | make/resources/android/AndroidManifest-Runtime.xml | 4 | ||||
-rw-r--r-- | make/resources/android/AndroidManifest-Test.xml | 4 | ||||
-rw-r--r-- | make/resources/android/res/values/colors.xml | 6 | ||||
-rw-r--r-- | make/resources/android/res/values/strings.xml | 10 | ||||
-rw-r--r-- | make/resources/android/res/values/styles.xml | 20 |
9 files changed, 160 insertions, 51 deletions
diff --git a/make/build-test.xml b/make/build-test.xml index 3435877..206815f 100644 --- a/make/build-test.xml +++ b/make/build-test.xml @@ -86,7 +86,7 @@ </path> <property name="junit.run.jars" value="${junit.jar}${path.separator}${ant.jar}${path.separator}${TestJarsInJar.jar}${path.separator}${gluegen.root}/${rootrel.build}/gluegen.jar${path.separator}${build_t}/gluegen-test.jar"/> <property name="junit.run.remote.jars" value="${junit.jar}${path.separator}${env.TARGET_ANT_HOME}/lib/ant.jar${path.separator}${env.TARGET_ANT_HOME}/lib/ant-junit.jar${path.separator}${gluegen.root}/make/lib/TestJarsInJar.jar${path.separator}${gluegen.root}/${rootrel.build}/gluegen.jar${path.separator}${build_t}/gluegen-test.jar"/> - <property name="junit.run.remote.apks" value="${ant-junit-all.apk}${path.separator}${gluegen.root}/${rootrel.build}/gluegen-rt.apk${path.separator}${build_t}/gluegen-test.apk${path.separator}${gluegen.root}/make/lib/TestJarsInJar.apk"/> + <property name="junit.run.remote.apks" value="${gluegen.root}/${rootrel.build}/jogamp.android-launcher.apk${path.separator}${ant-junit-all.apk}${path.separator}${gluegen.root}/${rootrel.build}/gluegen-rt.apk${path.separator}${build_t}/gluegen-test.apk${path.separator}${gluegen.root}/make/lib/TestJarsInJar.apk"/> <property name="stub.includes.dir" value="stub_includes" /> <!-- NOTE: this MUST be relative for FileSet --> diff --git a/make/build.xml b/make/build.xml index eb34305..1eaab32 100644 --- a/make/build.xml +++ b/make/build.xml @@ -103,6 +103,11 @@ <pathelement location="${antlr.jar}" /> </path> + <!-- Create the classpath for compiling Android only stuff. --> + <path id="android.classpath"> + <pathelement location="${android.jar}"/> + </path> + <!-- Create the classpath for compiling GlueGen. This requires the user-defined "antlr.jar" property. --> <path id="gluegencompile.classpath"> @@ -132,7 +137,8 @@ <property name="archive.name" value="gluegen-${gluegen.version}-${os.and.arch}" /> <property name="archive" value="${build}/${archive.name}" /> - <property name="gluegen.excludes.all" value="${gluegen.excludes.nsig}" /> + <property name="jogamp.android-launcher.classes" value="jogamp/android/launcher/**"/> + <property name="gluegen.excludes.all" value="${gluegen.excludes.nsig} ${jogamp.android-launcher.classes}" /> <property name="gluegen-rt.classes" value="com/jogamp/gluegen/runtime/**"/> <property name="jogamp.common.classes" value="com/jogamp/common/** jogamp/common/**"/> </target> @@ -519,7 +525,7 @@ <!-- - Build GlueGen. --> - <target name="pre-build"> + <target name="generate-hash-maps"> <!-- Int*Maps --> <antcall target="create-map" inheritrefs="true"> @@ -589,7 +595,7 @@ </target> <target name="gluegen.build.java" depends="gluegen.cpptasks.detect.os,gluegen.build.check.java" unless="gluegen.build.skip.java"> - <antcall target="pre-build" inheritRefs="true"/> + <antcall target="generate-hash-maps" inheritRefs="true"/> <!-- Because ANTLR looks for importVocab files in the current working directory, it likes to have all of its files, @@ -687,6 +693,8 @@ <jar destfile="${build}/gluegen.jar" manifest="${build}/Manifest.temp"> <fileset dir="${classes}"> <include name="**/*.class" /> + <exclude name="jogamp/common/os/android/**" /> + <exclude name="${jogamp.android-launcher.classes}" /> </fileset> </jar> @@ -707,6 +715,7 @@ <include name="com/jogamp/gluegen/runtime/*.class" /> <include name="com/jogamp/common/**" /> <include name="jogamp/common/**" /> + <exclude name="${jogamp.android-launcher.classes}" /> </fileset> </jar> @@ -727,6 +736,60 @@ </copy> </target> + <target name="gluegen.build.check.android-launcher" depends="init"> + <uptodate property="gluegen.build.skip.android-launcher"> + <srcfiles dir= "." includes="*.xml"/> + <srcfiles dir= "resources/android" includes="**/*.xml"/> + <srcfiles dir= "${src.java}/jogamp/android/launcher" includes="**"/> + <mapper type="merge" to="${build}/jogamp.android-launcher.jar"/> + </uptodate> + </target> + + <target name="android-launcher.build" depends="gluegen.cpptasks.detect.os,gluegen.build.check.android-launcher" if="isAndroid" unless="gluegen.build.skip.android-launcher"> + <javac destdir="${classes}" + includeAntRuntime="false" + includes="${jogamp.android-launcher.classes}" + memoryMaximumSize="${javac.memorymax}" + encoding="UTF-8" + source="${target.sourcelevel}" + target="${target.targetlevel}" + bootclasspath="${target.rt.jar}" + debug="${javacdebug}" debuglevel="${javacdebuglevel}"> + <src path="${src.java}" /> + <classpath refid="android.classpath" /> + </javac> + + <copy file="Manifest-android-launcher" + tofile="${build}/Manifest-android-launcher.temp" + overwrite="true"> + <filterset> + <filter token="VERSION" value="${gluegen.version}"/> + <filter token="SCM_BRANCH" value="${gluegen.build.branch}"/> + <filter token="SCM_COMMIT" value="${gluegen.build.commit}"/> + <filter token="BASEVERSION" value="${gluegen_base_version}"/> + </filterset> + </copy> + + <jar destfile="${build}/jogamp.android-launcher.jar" manifest="${build}/Manifest-android-launcher.temp"> + <fileset dir="${classes}"> + <include name="${jogamp.android-launcher.classes}" /> + </fileset> + </jar> + + <aapt.signed + jarbuilddir="${build}" + jarbasename="jogamp.android-launcher" + nativebuilddir="${build}" + nativebasename="non-existing" + android.abi="${android.abi}" + androidmanifest.path="resources/android/AndroidManifest-Launcher.xml" + androidresources.path="resources/android/res" + jarmanifest.path="${build}/Manifest-rt.temp" + version.code="${gluegen_int_version}" + version.name="${gluegen.version.plus}" + /> + </target> + <target name="gluegen.build.check.aapt" depends="init"> <uptodate property="gluegen.build.skip.aapt"> <srcfiles dir= "." includes="*.xml"/> @@ -751,24 +814,10 @@ version.name="${gluegen.version.plus}" /> - <!-- No need for a GlueGen Compile Time library on Android --> - <!-- aapt.signed - jarbuilddir="${build}" - jarbasename="gluegen" - nativebuilddir="${gluegen.lib.dir}" - nativebasename="gluegen-rt" - android.abi="${android.abi}" - androidmanifest.path="resources/android/AndroidManifest-CompileTime.xml" - androidresources.path="resources/android/res" - jarmanifest.path="${build}/Manifest.temp" - version.code="${gluegen_int_version}" - version.name="${gluegen.version.plus}" - /--> - </target> <target name="base.compile" description="Base compile ensuring valid build results w/o tampering the artifacts.properties" - depends="init, gluegen.build.java, gluegen.build.c" /> + depends="init, android-launcher.build, gluegen.build.java, gluegen.build.c" /> <target name="all.no_junit" description="Release build" depends="init, base.compile, tag.build, android.package, developer-zip-archive" /> <target name="all" description="Release build" depends="init, base.compile, tag.build, junit.compile, android.package, developer-zip-archive" /> 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> |