inglmka.blogg.se

Retrofit kotlin example github
Retrofit kotlin example github






retrofit kotlin example github retrofit kotlin example github retrofit kotlin example github

You should thus use this client for all API calls you may wish to protect.Īpproov errors will generate an ApproovException, which is a type of IOException. The interceptor may also add Approov-Token or substitute app secret values, depending upon your integration choices. This obtains a retrofit instance includes an OkHttp interceptor that protects channel integrity (with either pinning or managed trust roots). Return ApproovService.getRetrofit(retrofitBuilder !!) addConverterFactory( GsonConverterFactory.create()) Builder ? = null val retrofitInstance : Retrofit Package import import android.os.Bundle import import import import import import .activity_main.* import retrofit2.Call import retrofit2.Callback import retrofit2.Private static final String BASE_URL = " " private var retrofitBuilder : Retrofit. We will then pass in the parameter at that point. Then pass in the value after the query annotation.

retrofit kotlin example github

Inside the parenthesis, we pass in the name of the query Object containing data which is in the form of PopulaMovies object of the PopulaMoviesĭata class we created.Here is where we pass our api_key as query parameter. This is the path that is defined in the TMDB api for getting popular movies.Īfter that we create a function called getmovies that we will return a call Inside the brackets of it is the endpoint we will use to make the call. This call is of the type GET, that gets data back as a response from the server. TmdbEndpoints, Then add the code as show below. Will run the api using the specified endpoints. This interface will contain methods which when called Now we are going to create an interface to define the various endpoints Enter fullscreen mode Exit fullscreen mode








Retrofit kotlin example github