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.