Exploring the Android Studio
Tags: android, programming, computerscience
Published: 2021-04-20 06:43:08

In the last article, we learn <b><a href="https://dev.to/csj5483/how-to-create-a-project-in-android-studio-1a0c">How to create a project in Android Studio</a></b> and in this article we are going to explore the Android Studio.

After creating the project this screen will appear in Android Studio
![Exploring the Android Studio](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vwpk8si7ipc8ci75ve1f.png)
In this article, we will try to learn about the App folder and Gradle Scripts
![Exploring the Android Studio](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sc91iknb2224lkrugqt0.png)
As we can see in the above image there is <b>manifests</b> folder, inside this folder there is a file <b>AndroidManifests.xml</b>. When we click on this file, we will see something like this on our screen
![Exploring the Android Studio](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qy7j6w54v7bil112vlco.png)

<h3>AndroidManifests.xml:</h3>
<ul>
<li>This file describes essential information about our app to Operating System and Gooogle Play.</li>
<li>Manifest file is required to declare the app's package name
</li>
<li>It is required to declare the component of the app like:
<ul>
<li>activity</li>
<li>service</li>
<li>receiver</li>
<li>provider</li>

</ul>
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lm9i9fq77554fl6fw7me.png)

</li>
<li>This is the file where we have to add all uses-permission that we are using in our app. For example, if we want to read the external storage of use, then we have to add the following line in our AndroidManifests.xml file,
![Exploring the Android Studio](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/miuy5bxaqgn08wnmh1r1.png)
If we want to access other things, we have to follow the same process.
</li>

<li>We can change the launcher icon of our app from this file.
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6vgr3m3hc7h36an2miiy.png)
> <b>android:roundIcon</b> will be used on a device that uses roundIcon otherwise **android:icon** will be used
</li>

<li>In this file we declare what types of Hardware or Software feature our app requires. For example, if our app requires Bluetooth and without it, our app will not work, then we can declare this in the below way:
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/v6dxptphvud47431oons.png)
</li>
<li>We can define the intent-filter in this file.
>App activities, services, and broadcast receivers are activated by intents.

For example, we can change what activity will open when our app will open means we can change the launcher activity.
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/p7qb66l21s0fewgpnrif.png)
In the above image, we had chosen SecondActivity as our launcher activity.</li>
</ul>

<b>Java Folder</b> :
In this folder, we will write the code for our apps like what will happen when we click on the button and all.
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/o65rr04dmalv0arecmlo.png)
For example, in the above image, we have the file MainActivity. This file will handle the functionality of the MainActivity Screen.

<b>res folder</b>:
This folder is used to store the value of resources that we are using in our project like colors, strings, layout, styles and drawable.
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/64n4xbxmx96pywnmvi2c.png)
<ul>
<li><b>drawable:</b> This folder contains the different types of images used for the development of the application. It also contains the XML drawable which are used to describe shapes (color, border, gradient), state, transitions and more.

</li>

<li><b>layout:</b> It contains the XML code of all layouts of our project.
</li>

<li><b>mipmap:</b> It contains our app/launcher icons (which are shown on the home screen).
>It’s best practice to place our app icons in mipmap- folders (not the drawable- folders) because they are used at resolutions different from the device’s current density.
</li>
<li><b>values:</b> This folder contains the value of color, strings and style.
<ul><li><b>colors.xml:</b>
The colors.xml is an XML file that is used to store the colors for the resources. We can use these colors throughout our app.

</li>
<li><b>strings.xml:</b> It is used todefine the strings in one file so that it is easy to use same string in different positions in the android project</li>
<li><b>styles.xml:</b> In this file all the themes of android project are defined.</li>
</ul>
</li>
![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8pr907m8qcjn7u9hunm3.png)
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9ktsfh1cxpy8ltutp9ek.png)
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wdi7eiinpe631pn8lkmj.png)
 
</ul>

<h4>Gradle Script</h4>
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rugsdreyz4c8bl9sqtb0.png)
<b>build.gradle(Project:applicationName)</b> This file is in the root folder of the project and its configuration settings apply to every module in the project. A module is an isolated piece of the bigger project. In a multi-module project, these modules have their jobs but work together to form the whole project. Most Android projects only have one module, the app module.
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/58k51s2635ub4tl2mxgi.png)

<b>build.gradle(Module:applicationName.app):</b>: The file here is in the app folder. Its build settings apply only to the app module. If there were another module, then that module would have its build.gradle file, too.
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ais9gmpbmkin4xk9x8g0.png)
In this file we can define:<ul>
<li><b>applicationId:</b> This is the package name of our app</li>
<li><b>minSdkVersion:</b> It specifies the minimum API Level on which the application is able to run.</li>
<li><b>targetSdkVersion:</b> It specifies the API Level on which the application is designed to run</li>
<li><b>versionCode:</b> It's a positive integer that's used for comparison with other version codes. It's not shown to the user, it's just for record-keeping in a way.</li>
<li><b>versionName:</b> This is the version string seen by the user. It isn't used for internal comparisons or anything, it's just for users to see.</li>
<li><b>dependencies:</b> Dependencies refer to the things that supports in building your project, such as required JAR file from other projects and external JARs like JDBC JAR or Eh-cache JAR in the class path</li>
</ul>

Happy Learning!