Build: API Interface Definition Screen
This screen shows how to define a simple API interface in Kotlin for Android using Retrofit. It defines endpoints to fetch a list of items and a single item by ID.
Target UI
-------------------------
| API Interface Example |
|-----------------------|
| GET /items |
| GET /items/{id} |
|-----------------------|
| Define interface with |
| Retrofit annotations |
------------------------- Create a Kotlin interface named ApiService
Define a function to get a list of items with @GET("items")
Define a function to get a single item by ID with @GET("items/{id}") and @Path parameter
Use Retrofit Call<T> as return type for both functions