Last active
November 20, 2018 09:23
-
-
Save sharmadhiraj/b923572acc12e062d28609a75b5f4f6b to your computer and use it in GitHub Desktop.
Android Paging Library
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
interface NetworkService { | |
@GET("/everything?q=sports&apiKey=aa67d8d98c8e4ad1b4f16dbd5f3be348") | |
fun getNews(@Query("page") page: Int, @Query("pageSize") pageSize: Int): Single<Response> | |
companion object { | |
fun getService(): NetworkService { | |
val retrofit = Retrofit.Builder() | |
.baseUrl("https://newsapi.org/v2/") | |
.addCallAdapterFactory(RxJava2CallAdapterFactory.create()) | |
.addConverterFactory(GsonConverterFactory.create()) | |
.build() | |
return retrofit.create(NetworkService::class.java) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment