# OSGIService **Repository Path**: surpass_li/OSGIService ## Basic Information - **Project Name**: OSGIService - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 4 - **Created**: 2016-04-01 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README osgiService 是apkplug框架下osgi服务测试demo 这个demo主要演示插件与主程序osgi通讯。 1.项目分三个工程 1).osgiService 工程是宿主工程 ,它会注册一个showView服务,并且会监听printLog 2).osgiClient1 是插件1,它在启动时会提供注册printLog服务,并且会查找宿主程序提供的showView服务 3).osgiClient2 是插件2,它会查找宿主程序提供的showView服务 2.任务模式 1.宿主程序启动以后会注册一个showView服务供插件查询,并且会监听printLog 2.插件1启动以后会查询showView服务,并解析出一个View传递给主程序 3.插件1启动以后同时会注册一个printLog,这时宿主的这个printLog监听器将监听到 4.插件2启动以后会查询showView服务,并解析出一个View传递给主程序 5.插件停止时会查询showView服务,将View移除 3.注意事项 1.该项目中osgi服务接口类由主程序提供com.apkplug.osgi.service 所以插件只需导入其提供的service.jar包,而不需要真正打包到apk中,以免造成类冲突 2.插件是通过MyProperty.AutoInstall()安装,也就是说框架只安装并不自启动插件,利于演示