summaryrefslogtreecommitdiffstats
path: root/src/java/jogamp/android/launcher/MainLauncher.java
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2013-01-31 21:15:32 +0100
committerSven Gothel <[email protected]>2013-01-31 21:15:32 +0100
commitb47d0d92dd222999bf38633de1cec8de6a7ad369 (patch)
tree764afc7741b6cb5cf3a11f5d4a8d3c117b3b5f0e /src/java/jogamp/android/launcher/MainLauncher.java
parentc8de8fbf5d080b674b509763fbb7374c21ee705b (diff)
Android: Cleanup ClassLoaderUtil/LauncherUtil - Using cached parent ClassLoader for SYS-Packages w/ native libs, and non cached child ClassLoader for USR-Packages
Android's Dalvik VM, like a JVM, cannot load a native library from one location by multiple ClassLoader. Since we don't like to hardcode the system-packages, as it was before, i.e. "com.jogamp.common", "javax.media.opengl", we need to either copy the libs or use parenting of cached ClassLoader. The latter is chosen, since it's faster and uses less resources. - System-packages are passed through from the user 'List<String> LauncherUtil.BaseActivityLauncher::getSysPackages()' to the ActivityLauncher, which instantiates the ClassLoader. - No more hard-reference the system-packages in ClassLoaderUtil ("com.jogamp.common", "javax.media.opengl"), just use the new user provided system-packages. - The system-packages denominate a hash-key for caching, a new ClassLoader is created and mapped if it does not yet exist. - A non-chached user-packages ClassLoader is created using the cached system-packages ClassLoader as it's parent.
Diffstat (limited to 'src/java/jogamp/android/launcher/MainLauncher.java')
-rw-r--r--src/java/jogamp/android/launcher/MainLauncher.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/java/jogamp/android/launcher/MainLauncher.java b/src/java/jogamp/android/launcher/MainLauncher.java
index d4ac4ca..f37fa57 100644
--- a/src/java/jogamp/android/launcher/MainLauncher.java
+++ b/src/java/jogamp/android/launcher/MainLauncher.java
@@ -64,7 +64,7 @@ public class MainLauncher extends Activity {
data = LauncherUtil.DataSet.create(uri);
data.setSystemProperties();
- ClassLoader cl = ClassLoaderUtil.createClassLoader(this, data.getPackages(), false, Arrays.asList(frameworkAPKs));
+ ClassLoader cl = ClassLoaderUtil.createClassLoader(this, data.getSysPackages(), data.getUsrPackages(), Arrays.asList(frameworkAPKs));
if(null != cl) {
try {
staticContextClazz = Class.forName("jogamp.common.os.android.StaticContext", true, cl);