Demo: Retrofit
Part 1: Define your API interface
suspend fun getData(
//using the Sentiment API as an example
@Query("score") score: Float? = null,
//If you have multiple parameters to query write an @Query line for each of them.
@Header ("X-Api-Key") apiKey: String = "[your api-key]"
)Part 2: Complete the ViewModels
Part 3: Build your screens
Congrats, you've finished demo 6!
Last updated
Was this helpful?