Skip to content

Commit

Permalink
All required dependencies added
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthias Bruns committed May 20, 2017
1 parent d6a82e6 commit 6682f70
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 3 deletions.
29 changes: 29 additions & 0 deletions README.md
@@ -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'
````
7 changes: 4 additions & 3 deletions app/build.gradle
Expand Up @@ -30,10 +30,11 @@ dependencies {

// Retrofit http://square.github.io/retrofit
compile 'com.squareup.retrofit2:retrofit:2.3.0'
compile 'com.squareup.retrofit2:converter-gson:2.3.0'
compile 'com.squareup.retrofit2:adapter-rxjava2:2.3.0'




// GSON body parser
compile 'com.google.code.gson:gson:2.7'

androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
Expand Down

0 comments on commit 6682f70

Please sign in to comment.