Step 1. Add the JitPack repository to your build file
Add it in your root settings.gradle at the end of repositories:
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
}
}
Add it in your settings.gradle.kts at the end of repositories:
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
maven { url = uri("https://jitpack.io") }
}
}
Add to pom.xml
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
Add it in your build.sbt at the end of resolvers:
resolvers += "jitpack" at "https://jitpack.io"
Add it in your project.clj at the end of repositories:
:repositories [["jitpack" "https://jitpack.io"]]
Step 2. Add the dependency
dependencies {
implementation 'com.github.EnterPrayz:EventBus:'
}
dependencies {
implementation("com.github.EnterPrayz:EventBus:")
}
<dependency>
<groupId>com.github.EnterPrayz</groupId>
<artifactId>EventBus</artifactId>
<version></version>
</dependency>
libraryDependencies += "com.github.EnterPrayz" % "EventBus" % ""
:dependencies [[com.github.EnterPrayz/EventBus ""]]
EventBus is publish/subscribe event bus optimized for Android.<br/> <img src="EventBus-Publish-Subscribe.png" width="500" height="187"/>
EventBus...
EventBus is available on Maven Central. Please ensure that you are using the latest version by checking here
Gradle:
compile 'de.greenrobot:eventbus:2.4.0'
Maven:
<dependency>
<groupId>de.greenrobot</groupId>
<artifactId>eventbus</artifactId>
<version>2.4.0</version>
</dependency>
Or download EventBus from Maven Central
Details on EventBus and its API are available in the HOWTO document.
How does EventBus compare to other solutions, like Otto from Square? Check this comparison.
Q: How is EventBus different to Android's BroadcastReceiver/Intent system?<br/> A: Unlike Android's BroadcastReceiver/Intent system, EventBus uses standard Java classes as events and offers a more convenient API. EventBus is intended for a lot more uses cases where you wouldn't want to go through the hassle of setting up Intents, preparing Intent extras, implementing broadcast receivers, and extracting Intent extras again. Also, EventBus comes with a much lower overhead.
Q: How to do pull requests?<br/> A: Ensure good code quality and consistent formatting. EventBus has a good test coverage: if you propose a new feature or fix a bug, please add a unit test.
EventBus binaries and source code can be used according to the Apache License, Version 2.0.
greenrobot-common is a set of utility classes and hash functions for Android & Java projects.
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+ to stay up to date.