Created
July 6, 2018 18:30
-
-
Save ibrahimsn98/b95a9397012b2266093ddb735c8a7cf3 to your computer and use it in GitHub Desktop.
android-mvvm-with-dagger-2-module-network
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
@Module | |
public class NetworkModule { | |
private static final String BASE_URL = "https://api.github.com/"; | |
@Provides | |
static Retrofit provideRetrofit() { | |
return new Retrofit.Builder().baseUrl(BASE_URL) | |
.addCallAdapterFactory(RxJava2CallAdapterFactory.create()) | |
.addConverterFactory(GsonConverterFactory.create()) | |
.build(); | |
} | |
@Provides | |
static RepoService provideRepoService(Retrofit retrofit) { | |
return retrofit.create(RepoService.class); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment