Android Plugin-get Apkplug Framework installed plugin-03

Source: Internet
Author: User

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  

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.