Created
November 6, 2022 09:59
-
-
Save aqua30/6a83e1255cf263a0235bc179d4710be9 to your computer and use it in GitHub Desktop.
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
object RetrofitHelper { | |
/** | |
* as dependency injection is not used in this project for brevity, | |
* static object initialization is done for demo purpose. | |
* | |
* @param url: Base url for apis | |
* @return TestApis: Instance of the test api retrofit interface | |
**/ | |
fun testApiInstance(url: String): TestApis { | |
return Retrofit.Builder() | |
.baseUrl(url) | |
.addConverterFactory(GsonConverterFactory.create()) | |
.build() | |
.create(TestApis::class.java) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment