Open alexsilva opened 10 years ago
Works on pc:
package com.example.JavaDN;
import org.xeustechnologies.jcl.JarClassLoader;
import org.xeustechnologies.jcl.JclObjectFactory;
import java.net.MalformedURLException;
import java.net.URL;
/**
* Main
*/
public class Main {
public static void main(String[] args){
JarClassLoader mJcl = new JarClassLoader();
System.out.println("Loading lib...");
try {
mJcl.add(new URL("https://dl.dropboxusercontent.com/u/67269258/lib_class.jar"));
} catch (MalformedURLException e){
e.printStackTrace();
}
JclObjectFactory factory = JclObjectFactory.getInstance();
//Create object of loaded class
Object obj = factory.create(mJcl, "Math");
System.out.println("ready! " + obj);
}
}
I believe that the solution to this lies in the proxy (ProxyClassLoader)
http://larshamren.blogspot.com.br/2012/02/android-dynamically-loading-classes.html
The problem is to implement it.
Do not know if that library should work on android, but the test did not get good results.
Error: