Implementing a service

This class is responsible for the main task. It will be responsive for the control of all the tasks using the Retrofit.builder class and will configure it with the base of the given URL.   

Here is the code of UserServiceImpl.kt

class GithubServiceImpl{
fun getGithubServiceFactory(): GithubService {
val retrofit = Retrofit.Builder()
.baseUrl("https://api.github.com/")
.addConverterFactory(GsonConverterFactory.create())
.build()
return retrofit.create(GithubService::class.java)
}
}

Here, our baseUrl() is https://api.github.com/.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.135.216.75