Содержание
- 2. How to bring to your project compile 'com.squareup.retrofit2:retrofit:2.3.0' compile 'com.squareup.retrofit2:converter-gson:2.3.0'
- 3. What you need Model class which is used to map the JSON data to Interfaces which
- 4. Model Simple class with setters and getters public class TimeZoneApiResponse { @SerializedName("status") @Expose private String status;
- 5. Interface public interface TimeZoneAPI { @GET("get-time-zone") Call getTimeZone(@Query("key") String apiKey, @Query("format") String format, @Query("by") String searchBy,
- 6. Retrofit.Builder public TimeZoneAPI getTimeZoneAPI() { return new Retrofit.Builder() .baseUrl("http://api.timezonedb.com/v2/") .client(initClient()) .addConverterFactory(GsonConverterFactory.create()) .build().create(TimeZoneAPI.class); } @NonNull private OkHttpClient
- 7. Authorization
- 8. /** * An invocation of a Retrofit method that sends a request to a webserver and
- 9. How to deal with a Call public interface Callback { /** * Invoked for a received
- 11. Скачать презентацию