import retrofit2.Retrofit import retrofit2.converter.scalars.ScalarsConverterFactory import retrofit2.http.GET class MarsApiService { public val retrofit = Retrofit.Builder() .addConverterFactory(ScalarsConverterFactory.create()) .baseUrl(Companion.BASE_URL) .build() interface MarsApiService{ @GET("photos") fun getPhotos(): String } object MarsApi { val retrofitService: MarsApiService by lazy { retrofit.create(MarsApiService::class.java) } } companion object { private const val BASE_URL = "https://android-kotlin-fun-mars-server.appspot.com" } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)