Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Matthias Bruns
committed
May 20, 2017
1 parent
d6a82e6
commit 6682f70
Showing
2 changed files
with
33 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,32 @@ | ||
# RxAndroid 2 & Retrofit 2 | ||
|
||
This short guide explains how you setup and use Retrofit 2 with RxAndroid 2. | ||
|
||
## Project setup | ||
|
||
We need two dependencies for this project. Add the lines below to your build.gradle in your app project under **dependencies**. | ||
|
||
For RxAndroid: | ||
````gradle | ||
compile 'io.reactivex.rxjava2:rxandroid:2.0.1' | ||
compile 'io.reactivex.rxjava2:rxjava:2.1.0' | ||
```` | ||
and for Retrofit 2: | ||
````gradle | ||
compile 'com.squareup.retrofit2:retrofit:2.3.0' | ||
```` | ||
|
||
And add the adapter for retrofit2 to work with RxJava 2. | ||
|
||
````gradle | ||
compile 'com.squareup.retrofit2:adapter-rxjava2:2.3.0' | ||
```` | ||
|
||
**OPTIONAL** | ||
|
||
If you want to add support for GSON or another body parser, you can also add the following dependencies. | ||
|
||
````gradle | ||
compile 'com.google.code.gson:gson:2.7' | ||
compile 'com.squareup.retrofit2:converter-gson:2.3.0' | ||
```` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters