Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #1196 ✔️ Added description on dependency download in Android Studio #1214

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions docs/docs/Steps_To_Add_Dependency.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# :rocket: Overview
1. The Gradle build system in Android Studio helps us to include all the external dependencies in our project.

2. Let's say if we want to display an image in our app, we can add a library called `Picasso` or `Glide` Library.

3. There are some libraries that are default in every project that is mostly predefined by android when we create our project but there are some of the libraries we want to include in our project but they are not available in android studio.

4. So in that case we add external libraries to execute the required task.

# :rocket: Steps to add dependency in Android Studio

- Open Android Studio.

- Click on Open an existing Android Studio Project.

![image](https://user-images.githubusercontent.com/76740999/178974122-f4c1c6c6-9b56-4ae1-8cf5-62ac6d442cd2.png)

- Browse to the directory where you cloned the project.

- Select the `mentorship-android` directory and click open.

- Android Studio will download the libraries required to run the project and open it in a new window through build gradle process.

- Once the gradle process is done click on the `Project` view on left side and change it to `Android` view if not done already.

![123](https://user-images.githubusercontent.com/76740999/178977948-906642ec-a63b-424b-baf9-f37bb0abb13f.png)

- Once the project is opened in `Android` view head over to `Gradle Scripts > build.gradle.kts (Module: mentorship-android.app)`. All the external dependencies used in the project are included in this file.

![6](https://user-images.githubusercontent.com/76740999/178975230-30076def-9099-4ae4-8f7d-5c438c6df704.png)

- Let's say if we need to add `implementation(Dependencies.retrofit)` dependency to our project, we will paste the dependency under the `dependencies` section and `click` on the `Sync now` button at the top right so that it can fetch the library files and add it into our project. Once it's done we can add codes related to the library.

![7](https://user-images.githubusercontent.com/76740999/178977117-dd9c7161-1130-40a8-ab61-6fe4370f531e.png)

![8](https://user-images.githubusercontent.com/76740999/178977151-4e52133b-f1e1-4c50-972f-ad31547c410f.png)

- You can follow the same process to add any library you want in your project.

Happy Coding ! 🎉