Hey, do have a minute for a [quick survey](https://docs.google.com/forms/d/e/1FAIpQLSePA8NqA9Jlbvh28xcFVbmIGUzHW3dnsxuxi23-ZDPPfkWMSQ/viewform) on how we are doing with EventBus?
EventBus
========
EventBus is a publish/subscribe event bus for Android and Java.<br/>
<img src="EventBus-Publish-Subscribe.png" width="500" height="187"/>
EventBus...
* simplifies the communication between components
* decouples event senders and receivers
* performs well with Activities, Fragments, and background threads
* avoids complex and error-prone dependencies and life cycle issues
* makes your code simpler
* is fast
* is tiny (~50k jar)
* is proven in practice by apps with 100,000,000+ installs
* has advanced features like delivery threads, subscriber priorities, etc.
[![Build Status](https://travis-ci.org/greenrobot/EventBus.svg?branch=master)](https://travis-ci.org/greenrobot/EventBus)
EventBus in 3 steps
-------------------
1. Define events:
```java
public static class MessageEvent { /* Additional fields if needed */ }
```
2. Prepare subscribers:
Declare and annotate your subscribing method, optionally specify a [thread mode](http://greenrobot.org/eventbus/documentation/delivery-threads-threadmode/):
```java
@Subscribe(threadMode = ThreadMode.MAIN)
public void onMessageEvent(MessageEvent event) {/* Do something */};
```
Register and unregister your subscriber. For example on Android, activities and fragments should usually register according to their life cycle:
```java
@Override
public void onStart() {
super.onStart();
EventBus.getDefault().register(this);
}
@Override
public void onStop() {
super.onStop();
EventBus.getDefault().unregister(this);
}
```
3. Post events:
```java
EventBus.getDefault().post(new MessageEvent());
```
Read the full [getting started guide](http://greenrobot.org/eventbus/documentation/how-to-get-started/).
Add EventBus to your project
----------------------------
<a href="https://search.maven.org/#search%7Cga%7C1%7Cg%3A%22org.greenrobot%22%20AND%20a%3A%22eventbus%22"><img src="https://img.shields.io/maven-central/v/org.greenrobot/eventbus.svg"></a>
Via Gradle:
```gradle
compile 'org.greenrobot:eventbus:3.1.1'
```
Via Maven:
```xml
<dependency>
<groupId>org.greenrobot</groupId>
<artifactId>eventbus</artifactId>
<version>3.1.1</version>
</dependency>
```
Or download [the latest JAR](https://search.maven.org/remote_content?g=org.greenrobot&a=eventbus&v=LATEST) from Maven Central.
Homepage, Documentation, Links
------------------------------
For more details please check the [EventBus website](http://greenrobot.org/eventbus). Here are some direct links you may find useful:
[Features](http://greenrobot.org/eventbus/features/)
[Documentation](http://greenrobot.org/eventbus/documentation/)
[ProGuard](http://greenrobot.org/eventbus/documentation/proguard)
[Changelog](http://greenrobot.org/eventbus/changelog/)
[FAQ](http://greenrobot.org/eventbus/documentation/faq/)
How does EventBus compare to other solutions, like Otto from Square? Check this [comparison](COMPARISON.md).
License
-------
Copyright (C) 2012-2017 Markus Junginger, greenrobot (http://greenrobot.org)
EventBus binaries and source code can be used according to the [Apache License, Version 2.0](LICENSE).
More Open Source by greenrobot
==============================
[__ObjectBox__](http://objectbox.io/) ([GitHub](https://github.com/objectbox/objectbox-java)) is a new superfast object-oriented database for mobile.
[__Essentials__](http://greenrobot.org/essentials/) ([GitHub](https://github.com/greenrobot/essentials)) is a set of utility classes and hash functions for Android & Java projects.
[__greenDAO__](http://greenrobot.org/greendao/) ([GitHub](https://github.com/greenrobot/greenDAO)) is an ORM optimized for Android: it maps database tables to Java objects and uses code generation for optimal speed.
[Follow us on Google+](https://plus.google.com/b/114381455741141514652/+GreenrobotDe/posts) or check our [homepage](http://greenrobot.org/) to stay up to date.
没有合适的资源?快使用搜索试试~ 我知道了~
EventBus 3.1.1
共132个文件
java:96个
gradle:8个
xml:5个
需积分: 13 8 下载量 66 浏览量
2017-12-02
19:46:59
上传
评论
收藏 265KB ZIP 举报
温馨提示
EventBus 3.1.1版本。 EventBus is a publish/subscribe event bus for Android and Java. simplifies the communication between components decouples event senders and receivers performs well with Activities, Fragments, and background threads avoids complex and error-prone dependencies and life cycle issues makes your code simpler is fast is tiny (~50k jar) is proven in practice by apps with 100,000,000+ installs has advanced features like delivery threads, subscriber priorities, etc.
资源推荐
资源详情
资源评论
收起资源包目录
EventBus 3.1.1 (132个子文件)
gradlew.bat 2KB
stylesheet.css 13KB
background.gif 2KB
.gitignore 341B
.gitignore 10B
build.gradle 5KB
build.gradle 4KB
build.gradle 2KB
build.gradle 987B
build.gradle 814B
build.gradle 578B
build.gradle 486B
settings.gradle 299B
gradlew 5KB
gradle-wrapper.jar 53KB
EventBusTestSubscriberInJar-3.0.0.jar 3KB
EventBusTestSubscriberInJar-3.0.0.jar 3KB
EventBus.java 23KB
EventBusAnnotationProcessor.java 19KB
SubscriberMethodFinder.java 11KB
ErrorDialogManager.java 11KB
PerfTestEventBus.java 10KB
EventBusBasicTest.java 9KB
EventBusBuilder.java 8KB
EventBusMultithreadedTest.java 7KB
PerfTestOtto.java 7KB
EventBusOrderedSubscriptionsTest.java 6KB
EventBusStickyEventTest.java 6KB
EventBusInheritanceDisabledTest.java 6KB
EventBusInheritanceTest.java 5KB
TestSetupActivity.java 5KB
ErrorDialogFragmentFactory.java 4KB
AsyncExecutor.java 4KB
EventBusFallbackToReflectionTest.java 4KB
EventBusCancelEventDeliveryTest.java 4KB
EventBusMainThreadRacingTest.java 4KB
AbstractEventBusTest.java 4KB
TestRunnerActivity.java 4KB
ErrorDialogFragments.java 4KB
EventBusRegistrationRacingTest.java 3KB
EventBusAndroidMultithreadedTest.java 3KB
EventBusBuilderTest.java 3KB
ThreadMode.java 3KB
AbstractSubscriberInfo.java 3KB
ExceptionToResourceMapping.java 3KB
HandlerPoster.java 3KB
EventBusGenericsTest.java 3KB
TestParams.java 3KB
ErrorDialogConfig.java 3KB
TestRunner.java 3KB
EventBusNoSubscriberEventTest.java 3KB
EventBusSubscriberLegalTest.java 2KB
SubscriberMethod.java 2KB
BackgroundPoster.java 2KB
EventBusAndroidOrderTest.java 2KB
AndroidLogger.java 2KB
EventBusSubscriberExceptionTest.java 2KB
Test.java 2KB
EventBusAndroidActivityTest.java 2KB
AbstractAndroidEventBusTest.java 2KB
EventBusIndexTest.java 2KB
PendingPost.java 2KB
EventBusMethodModifiersTest.java 2KB
Logger.java 2KB
ThrowableFailureEvent.java 2KB
EventBusMainThreadTest.java 2KB
ClassMapPerfTest.java 2KB
TestBackgroundPoster.java 2KB
EventBusBackgroundThreadTest.java 2KB
Subscription.java 2KB
SimpleSubscriberInfo.java 2KB
PendingPostQueue.java 2KB
Subscribe.java 2KB
SubscriberExceptionEvent.java 2KB
SubscriberMethodInfo.java 2KB
AsyncPoster.java 1KB
MainThreadSupport.java 1KB
EventBusAndroidCancelEventDeliveryTest.java 1KB
SubscribeClassEventBusDefault.java 1KB
EventBusException.java 1KB
NoSubscriberEvent.java 1KB
EventBusSubscriberInJarTest.java 1KB
EventBusBackgroundThreadTestWithIndex.java 1KB
EventBusInheritanceDisabledTestWithIndex.java 1KB
EventBusBasicTestWithIndex.java 1KB
EventBusSubscriberInJarTestWithIndex.java 1KB
Indexed.java 1KB
Poster.java 1KB
SubscriberInfo.java 1018B
EventBusFallbackToReflectionTestWithIndex.java 991B
EventBusOrderedSubscriptionsTestWithIndex.java 989B
EventBusSubscriberExceptionTestWithIndex.java 987B
EventBusCancelEventDeliveryTestWithIndex.java 986B
EventBusRegistrationRacingTestWithIndex.java 984B
EventBusNoSubscriberEventTestWithIndex.java 980B
EventBusMainThreadRacingTestWithIndex.java 978B
EventBusMethodModifiersTestWithIndex.java 974B
EventBusMultithreadedTestWithIndex.java 968B
EventBusStickyEventTestWithIndex.java 962B
EventBusInheritanceTestWithIndex.java 962B
共 132 条
- 1
- 2
资源评论
guo_jianwen
- 粉丝: 17
- 资源: 4
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- gadget驱动研究论文
- 组装式箱式变电站3款工程图机械结构设计图纸和其它技术资料和技术方案非常好100%好用.zip
- rongxin11111111
- 116395807409340大猫vb登陆器.apk
- Win11操作系统高效快捷键全面指南
- Windows 10快捷键大全:提升工作效率的操作指南
- 2024年最全Nmap扫描技术与案例集锦(15类场景,102种命令)
- DigiShow 教程1 基本概念
- DigiShow 教程2 软件安装使用入门
- DigiShow 教程3 信号映射
- DigiShow 教程4 软件常用操作
- 小戴人工智能PurposeAI-20241205分词字符集识别的程序的详细解释 (第三版)
- SARibbon-qt
- EasyCode-sql server
- brightnessUI-ubuntu
- Pyqt5-pyqt5
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功