Android上使用jspf插件框架的方法
本文實(shí)例講述了Android上使用jspf插件框架的方法。分享給大家供大家參考。具體如下:
jspf (Java Simple Plugin Framework) 是一個(gè)插件框架,集成了很多 IoC 框架的概念在里面。
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; public class JSPFDemo extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(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.textView); textView.setText(plugin.sayHello()); } }
希望本文所述對(duì)大家的Android程序設(shè)計(jì)有所幫助。
- 解析離線安裝Eclipse的Android ADT開發(fā)插件的具體操作(圖文)
- Android實(shí)現(xiàn)QQ搶紅包插件
- Android中微信搶紅包插件原理解析及開發(fā)思路
- 為Android Studio編寫自定義Gradle插件的教程
- 分享Android微信紅包插件
- Android搶紅包插件實(shí)現(xiàn)原理淺析
- Android桌面插件App Widget用法分析
- APP添加CNZZ統(tǒng)計(jì)插件教程 Android版添加phonegap
- Android微信自動(dòng)搶紅包插件優(yōu)化和實(shí)現(xiàn)
- Android系統(tǒng)實(shí)現(xiàn)DroidPlugin插件機(jī)制
相關(guān)文章
解決Android studio用真機(jī)調(diào)試時(shí)logcat一直輸出日志問題
這篇文章主要介紹了解決Android studio用真機(jī)調(diào)試時(shí)logcat一直輸出日志問題,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過來看看吧2020-04-04android studio使用SQLiteOpenHelper()建立數(shù)據(jù)庫(kù)的方法
這篇文章主要介紹了android studio使用SQLiteOpenHelper()建立數(shù)據(jù)庫(kù)的方法,本文給大家介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或工作具有一定的參考借鑒價(jià)值,需要的朋友可以參考下2020-03-03Android原生側(cè)滑控件DrawerLayout使用方法詳解
這篇文章主要為大家詳細(xì)介紹了Android原生側(cè)滑控件DrawerLayout的使用方法,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2017-12-12Android實(shí)現(xiàn)文件上傳和下載倒計(jì)時(shí)功能的圓形進(jìn)度條
這篇文章主要介紹了Android實(shí)現(xiàn)文件上傳和下載倒計(jì)時(shí)功能的圓形進(jìn)度條,需要的朋友可以參考下2017-09-09基于Android SDK-在64位Linux中使用需要注意的問題
本篇文章是對(duì)Android SDK-在64位Linux中使用需要注意的問題進(jìn)行了詳細(xì)的分析介紹,需要的朋友參考下2013-05-05Android自定義控件(實(shí)現(xiàn)視圖樹繪制指示器)
本文主要介紹了Android視圖樹繪制指示器的實(shí)現(xiàn)原理和具體步驟。具有一定的參考價(jià)值,下面跟著小編一起來看下吧2017-01-01react native中的聊天氣泡及timer封裝成的發(fā)送驗(yàn)證碼倒計(jì)時(shí)
這篇文章主要介紹了react native中的聊天氣泡及timer封裝成的發(fā)送驗(yàn)證碼倒計(jì)時(shí)的相關(guān)資料,需要的朋友可以參考下2017-08-08Android實(shí)現(xiàn)微信自動(dòng)搶紅包的程序
簡(jiǎn)單實(shí)現(xiàn)了微信自動(dòng)搶紅包的服務(wù),原理就是根據(jù)關(guān)鍵字找到相應(yīng)的View, 然后自動(dòng)點(diǎn)擊,接下來通過本文給大家介紹Android實(shí)現(xiàn)微信自動(dòng)搶紅包的程序,對(duì)android微信自動(dòng)搶紅包相關(guān)知識(shí)感興趣的朋友一起學(xué)習(xí)吧2016-02-02