- 授权协议: GPL
- 开发语言: Java
- 操作系统: 跨平台
- 软件首页: https://github.com/cangwang/ModuleBus/tree/master
- 软件文档: https://github.com/cangwang/ModuleBus/blob/master/README.md
软件介绍
ModuleBus
用法上面尽可能靠近 EventBus,大小大概54K没做任何压缩。
已经上传到 JCenter 了,可以直接调用
添加 ModuleBus 到你的项目
Gradle:
compile 'com.cangwang.core:modulebus:1.0.1'
简单介绍一下
需要自己定义一个 Client 用于传输,需要继承于 IBaseClient
然后 ModuleEvent 的 coreClientClass 用于指定对应的 Client,然后添加实现的方法,方法名任意都可以。
然后 register 和 unregister 的方法都和 EventBus 的用法是一样的
post 的方法需要填写第一个参数为 client.class,第二个参数是方法名,之后的参数为方法的参数。
ModuleBus in 3 steps
Define events:
public static class MessageClient extend IBaseClient { /* Additional fields if needed */ }Prepare ModuleEvent and function: Declare and annotate your subscribing method.
@ModuleEvent(coreClientClass = MessageClient.Class) public void fun(Object...args) {/* Do something */};Register and unregister your ModuleBus. For example on Android, activities and fragments should usually register according to their life cycle:
@Override public void onStart() { super.onStart(); ModuleBus.getInstance().register(this); } @Override public void onDestroy() { super.onStop(); ModuleBus.getInstance().unregister(this); }Post function:
ModuleBus.getInstance().post(MessageClient.class,"fun",Object...args);
这里需要在 base 的 module 去添加依赖 modulebus ,然后其他需要交互的模块依赖于 base。
例子里面会有简单的演示,只要下载之后就能看到源码和调用了。我也会封装越来越好用得功能到里面。
物联网导论(第2版)
刘云浩 / 科学出版社 / 2013-8 / 45.00元
物联网是一个基于互联网、传统电信网等信息承载体,让所有能够被独立寻址的普通物理对象实现互联互通的网络。它具有普通对象设备化、自治终端互联化和普适服务智能化三个重要特征。 《物联网工程专业系列教材:物联网导论(第2版)》从物联网的感知识别层、网络构建层、管理服务层和综合应用层这四层分别进行阐述,深入浅出地为读者拨开萦绕于物联网这个概念的重重迷雾,引领求知者渐渐步入物联网世界,帮助探索者把握第三......一起来看看 《物联网导论(第2版)》 这本书的介绍吧!
