How to use the JSPF plug-in framework on Android _android

Source: Internet
Author: User

This example describes the approach to using the JSPF plug-in framework on Android. Share to everyone for your reference. Specifically as follows:

The JSPF (Java simple Plugin framework) is a plug-in framework that integrates the concepts of many IoC frameworks inside.

Package De.jspfdemo;
Import Net.xeoh.plugins.base.PluginManager;
Import Net.xeoh.plugins.base.impl.PluginManagerFactory;
Import Net.xeoh.plugins.base.util.uri.ClassURI;
Import android.app.Activity;
Import Android.os.Bundle;
Import Android.widget.TextView;
Import De.jspfdemo.plugins.CoolPlugin;
Import De.jspfdemo.plugins.impl.CoolPluginImpl; The public class Jspfdemo extends activity {/** called the ' when the ' is the ' The activity ' is a./@Override public void created
    Reate (Bundle savedinstancestate) {super.oncreate (savedinstancestate);
    Setcontentview (R.layout.main);
    Loading and adding plugins via class uri PlugInManager pm = Pluginmanagerfactory.createpluginmanager ();
    Pm.addpluginsfrom (New Classuri (Coolpluginimpl.class). Touri ());
    Getting the coolplugin coolplugin plugin = pm.getplugin (Coolpluginimpl.class); Setting the text of a TextView with the help of the coolplugin TextView TextView = (TextView) Findviewbyid (R.id.tex
    Tview); Textview.setteXT (Plugin.sayhello ());

 }
}

I hope this article will help you with your Android program.

Related Article

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.