Include this script into your page along with the iframe for a responsive media embed
In this video series we will learn how to use Retrofit, which is a type-safe HTTP client for Android and Java.nRetrofit allows easy communication with a web service by abstracting the HTTP API into a Java interface. nnIn part 1 we will set up Retrofit in a new Android Studio project by adding the necessary Gradle dependencies, and then already do our first GET request. nWe create an interface with 1 method that we annotate with @GET and the relative URL to the API endpoint of the REST API we want to query. We then create a Retrofit instance, define the baseUrl, add GSON as the converter by passing GsonConverterFactory to the addConverterFactory method, and let Retrofit create the implementation of our API interface at compile time.nThe Call object that our GET method returns encapsulates a single request + response. With enqueue we can execute this request asynchcronously on a background thread and get our result back in the onResponse callback. OnFailure will be called if something in the process of communicating with the server or processing the response went wrong. With isSuccessFull we check if our response code is between 200 and 300 and if that's the case we can retrieve our result from the response body.nGSON will parse the array of JSON objects into a List of the Java model class that we prepared beforehand.nnWatch the whole playlist:nwww.youtube.com/playlist?list=PLrnPJCHvNZuCbuD3xpfKzQWOj3AXybSaMnnExample code, links & dependencies:ncodinginflow.com/tutorials/android/retrofit/part-1-simple-get-requestnn____________________nSubscribe to my channel:nwww.youtube.com/c/codinginflow?sub_confirmation=1nnWant more Android tutorials? Check my playlist section:nwww.youtube.com/c/codinginflow/playlistsnnnFollow me on social media:nnFacebook:nwww.facebook.com/codinginflownnInstagram:nhttps://www.instagram.com/codinginflownnTwitter:nhttps://twitter.com/codinginflownnBlog:nhttps://codinginflow.com/