Mobius is a functional reactive framework for managing state evolution and side-effects, with add-ons for connecting to Android UIs and RxJava Observables. It emphasizes separation of concerns, testability, and isolating stateful parts of the code.
To learn more, see the wiki for a user guide. To see Mobius in action, check out the sample TODO app based on the app from Android Architecture Blueprints. You can also watch a talk from Android @Scale introducing Mobius.
Mobius is in Production status, meaning it is used in production in Spotify Android applications, and that we consider the APIs to be stable and the implementation bug-free. We will not make backwards-compatibility-breaking changes.
Mobius is currently built for Java 7 (because Java 8 is not fully supported on all versions of Android), hence the duplication of some concepts defined in
When using Mobius, we recommend using Kotlin or Java 8 or later, primarily because of the improved type inference and because using lambdas greatly improves readability and conciseness of code.
Using it in your project
The latest version of Mobius is available through Maven Central (LATEST_RELEASE below is ):
implementation 'com.spotify.mobius:mobius-core:LATEST_RELEASE' testImplementation 'com.spotify.mobius:mobius-test:LATEST_RELEASE' implementation 'com.spotify.mobius:mobius-rx:LATEST_RELEASE' // only for RxJava 1 support implementation 'com.spotify.mobius:mobius-rx2:LATEST_RELEASE' // only for RxJava 2 support implementation 'com.spotify.mobius:mobius-android:LATEST_RELEASE' // only for Android support implementation 'com.spotify.mobius:mobius-extras:LATEST_RELEASE' // utilities for common patterns
We're using Google's auto-formatter to format the code. The build pipeline is set up to fail builds that aren't correctly formatted. To ensure correct formatting, run
Code of Conduct
This project adheres to the Open Code of Conduct. By participating, you are expected to honor this code.