it's possible with the use of the classloader.
add this method to your Activity
request the plugin information by an custom broadcast.
the plugin have to response and submit
pluginapk = plugin_context.getPackageCodePath()
canonnicalCalssName = plugin1.class.getCanonicalName()
use this Strings as loadPlugin args
private Class<?> loadPlugin(String pluginapk, String
canonnicalCalssName) throws ClassNotFoundException {
pluginapk += ":/data/app/"+this.getPackageCodePath(); // append
your
own apk to the class path
// get the lib path if you use jni
String ldpath = "/data/data/" + canonnicalCalssName.substring(0,
canonnicalCalssName.lastIndexOf(".")) + "/lib";
PathClassLoader cl = new PathClassLoader(pluginapk,
ldpath.toString(), ClassLoader.getSystemClassLoader());
return Class.forName(canonnicalCalssName, true, cl);
}
initialize the plugin class and make the best of it.
christoph polcin
http://www.christoph-polcin.com/
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en