The previous article succeeded in embedding the Apkplug framework in the app and launching the link http://www.apkplug.com/blog/?post=10 This article implements how to get all installed plugins
A context that gets the systembundle of the frame Bundlecontext
Apkplug Framework startup automatically creates a Systembundle, which is the first plugin of the framework that cannot be stopped and unloaded, through which we can communicate with Apkplug and other plugins
Frameworkinstance.getsystembundle () can get to systembundle but it doesn't make much sense, we need to get its run context Bundlecontext
Bundlecontext context =frame.getsystembundlecontext ();
Two get installed plugins via Bundlecontext
for (int i=0;i<context.getbundles (). length;i++)
{
Get Installed Plugins
Print plugin Information
StringBuffer sb=new StringBuffer ();
Sb.append ("\ n Plugin Name:" +b.getname ());
Sb.append ("\ n Plugin Application name:" +b.getsymbolicname ());
Sb.append ("\ n plugin version:" +b.getversion ());
Sb.append ("\ n Plugin ID:" +b.getbundleid ());
Sb.append ("\ n Plugin Current status:" +b.getstate ());
Sb.append ("\ n Plugin Startup activity:" +b.getbundleactivity ());
System.out.println (Sb.tostring ());
}
This way we get all the installed plugins, and we can get the plugin information through the bundle or manipulate the plugins (start, uninstall, launch plugin activity, etc.)
Official website www.apkplug.com
QQ Exchange Group: 132433459