Day90 of #100DaysOfCode

Day90 of #100DaysOfCode

Hii folks 🙌

Today I will be continuing the same pathway in which we will learn about Web Services and Retrofit dependencies

Unit 4: Internet

Pathway 2: Get and Display Data

https://developer.android.com/courses/android-basics-kotlin/course

Retrofit Library

The retrofit library will communicate with the backend. It creates URI’s for the web service based on the parameters we pass to it.

Adding Retrofit dependencies

  • We will then open the project’s top-level level build.gradle(Project: MarsPhotos) file. We will see two repositories, google(), mavenCentral().
repositories {
google()
mavenCentral()
}
  • Then we will Open module level gradle file, build.gradle (Module: MarsPhots.app).
  • In the dependencies section, we will add these lines for the Retrofit libraries
// Retrofit 
implementation "com.squareup.retrofit2:retrofit:2.9.0"
// Retrofit with Moshi Converter
implementation "com.squareup.retrofit2:converter-scalars:2.9.0"
  • Click Sync Now to rebuild the project with the new dependencies.

Add support for Java 8 language features

  • To use the built-in features, we need the following code in the module’s build.gradle file. This step is already done for us, so we will make sure the following code is present in our build.gradle(Module: MarsPhotos.app).
android {
...
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

kotlinOptions {
jvmTarget = '1.8'
}
}

That is all for Day90 ✅

Thanks for reading, See you tomorrow!

--

--

--

https://www.linkedin.com/in/itskushagra

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Git from ZERO to HERO — The Basics

Best Practices for Deploying Confluent Kafka, Spring Boot & Distributed SQL Based Streaming Apps…

Rails 6 jQuery Using Webpacker

Notion.so-style know-how sharing personally, and on business — with OneNote

Working with Retrofit

Azure Fundamentals Part 1: Study Guide

Quick Start To Terraform on AWS.

sed: Replacing variableURLs in a file for iOS

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Kushagra Kesav

Kushagra Kesav

https://www.linkedin.com/in/itskushagra

More from Medium

Day68 of #100DaysOfCode

Day65 of #100DaysOfCode

Day71 of #100DaysOfCode

Day80 of #100DaysOfCode