The easiest way to add Gradle dependency in an Android studio

Hitesh Dhamshaniya
2 min readJun 1, 2020

In this post, we are going to learn another way to add required dependency into the android studio.

The traditional way to add gradle dependency into the project is to Google it and check the updated version or our prefered version copy it and go to app → build.gradle file and add it. Most of us do it in that way, I have been doing it. Now I come across with new cool short-cut way to add it.

Let’s find that short-cut

Go to File → Project Structure. or simply CTRL+ALR+SHIFT+S. We will have the project structure dialog, as shown in image below.

Android studio project structure dialog.

Select Dependencies from the left menu, we can see the number of dependencies we already had added. Click the + icon below the label all dependencies, we will have two option for dependencies. 1. Library dependency and 2. Jar dependency, we will go with library dependency.

All dependencies + add a new library dependency

Once we click on Library Dependencies or press 1 as a short cut, we will have below new dialog, where we have the option to search gradle.

Add Library Dependency

Let’s try to search recyclervew in the Search box. We can see it in the above screenshot its step 1. We get the below result when searching for recyclerview.

Search for recycler view and get above result

When the search for any gradle we will have a list of related gradle and its version, one can see in the right side of the above dialog and In step 2 we can select the configuration of the gradle i.e implementation, releaseimplementation, testimplementation and so forth.

So, this is the easy and cool method to add dependency gradle, please let me know your thought on it if any.

Thanks for reading… Happy Coding…

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

Hitesh Dhamshaniya
Hitesh Dhamshaniya

No responses yet

Write a response