A Super Easy Guide to Build Your First Android App in Java Using Android Studio

A Super Easy Guide to Build Your First Android App in Java Using Android Studio
Image Source: Android Studio IDE Screenshot

Creating Your First Android Studio Project is Vital

It always creates goosebumps in the dreamers when they are going to take the first step toward their dream. The same is the case for those who want to learn android development and looking for the right guide and path. It's really vital for the learners who are spending their time and energy learning android development. So if you are reading this blog, I assure you that you are on the right track. Believe me or not, Creating your first project and building your first android app is going to be a super easy task for you and this tutorial will also cover some other basic concepts too. So, be ready, and let's get started building your first android app.

Important Note:

Before starting the android studio guide, I want to recommend you have a good and stable internet connection to avoid any kind of inconvenience, disturbance, uneasiness, and cumbersomeness.

Step 1:

First of all, open your android studio. You will see the following screen will different options. You can see a highlighted option in a red colored rectangle saying "Start a new android studio project". By clicking on this option and a new window will pop up.

A Super Easy Guide to Build Your First Android App in Java Using Android Studio
Image Source: Android Studio IDE Screenshot

Select a Project Template:

This new window will offer you some readymade app templates. You can select any of them but as you are learning to build your first android studio app in java, I suggest you select the empty activity and click on the next button. This empty activity can be converted to any other template if you have good coding skills and those we will learn in our upcoming tutorials.

Build Your First Android App
Image Source: Android Studio IDE Screenshot

Configure Your Project:

After clicking on the next button, I new window will pop up and this window is very important. You need to learn the options given in this window very carefully. The first option is related to the name of the app you want to create. As we are building our first android studio app in java using android studio so I named it "My First Android App".
The second option is "Package Name". This package name is used by android devices to differentiate between different android apps so this package name should be unique and different for your different apps.

Super Easy Guide to Convert Your Website Into an Android Mobile App

Then the third option will specify the location of your project and you can leave this as it is.
The language of your project should be selected "Java" as we are creating our android studio project in java. The minimum SDK should be selected such as your app can cover the maximum number of devices. That's it. Now just click on the finish button and your project is created and ready to build.

Build Your First Android App
Image Source: Android Studio IDE Screenshot

Step 2:

Important Note:

When you have created your first project successfully, the next step is to build your android studio project. But before heading towards building your project, I want to discuss some of the things with you which are very important to understand and learn for android development.

MainActivity.java file:

This is the window that will appear after clicking the finish button. This window contains two types of files. The first one is an XML file and the second is a Java file. This Java file is used to code for your app. This is the main activity file and is very important for your project.

Build Your First Android App
Image Source: Android Studio IDE Screenshot

activity_main.xml:

This is the main XML file and you can say that the main user interface of your app. This file is used to create the front view of your app. On the left side, you can see a palette section that has different ingredients available for your app. You can drag and drop all these ingredients in your app and make use of them.
On the right side, you can see three different options code, split, and design. Currently, the design option is selected and you can see this window which has only the UI section. If you click on the code, the code section will appear only. But if you click on the "Split" button, it will show you the code and the UI at the same time.

Activity_main.xml
Image Source: Android Studio IDE Screenshot
This is the window you will see after clicking the "Split" button. On the left side, you can edit your XML code and on the right side, you can monitor the effects of that code on the UI of your app.
Activity_main.xml
Image Source: Android Studio IDE Screenshot

Android Manifest File:

This file is as important for android apps as the brain for the human body. This file contains all the information regarding your app. This is the file that is read by android OS when your app is installed on an android device. This file tells the OS what is the name of the application, the package name, the name and number of activities, the parent activities and their child's activities, the permissions required for the app, the services, and much more information. So if you want to ask for some special permissions you need to add those permissions in this file and how to add them here, we will learn this in upcoming tutorials.

Android Manifest
Image Source: Android Studio IDE Screenshot

build.gradle (Module: app) File:

This is another important file and you need to learn this file also. First of all, you need to locate this file. After your project builds successfully, you will see a project option selected on the left side and there will be an elephant sign. You need to maximize it as I have done and the following options will appear. The first two files are build.gradle files but you need to select the second file which are displaying Module: app text in the bracket. Double-click on this file and it will open in the editor section.

Build.gradle File
Image Source: Android Studio IDE Screenshot

As I mentioned earlier this file is also very important as it contains the information on compile SDK version, the Build tools version, the application ID, the minimum SDK version, the target SDK version, the version code, the version name, and the dependencies used in your app all are listed here. This file must be synced successfully and properly.

Build.gradle File
Image Source: Android Studio IDE Screenshot

Build Your First Android Studio Project:

We have to go through all the basic and important steps and now we will build our first android app in android studio. At the top of your android studio, you can see the following options. 

Build Your First Android Studio Project
Image Source: Android Studio IDE Screenshot

At number 8 you can see an option "Build" this is used to build the apps and for some other purposes too. We will discuss them later now we will just discuss the build option only. As you click on this button, it will drop down and the following options will appear.

Build Your First Android Studio Project
Image Source: Android Studio IDE Screenshot
There is an option "Build Bundle(s) / APK (s) click on that option and it will further dropdown.
Build Your First Android Studio Project
Image Source: Android Studio IDE Screenshot

Here you need to select the "Build APK(s) option.

Note:

You can also select the "Generate Signed Bundle / APK" option but that is used when we need to publish our apps on the app store and we will learn that option later on.

After selecting the "Build APK(s) option the gradle build will start running at the bottom of your android studio and it will take some time to build your app. Have patience.

Build Your First Android Studio Project
Image Source: Android Studio IDE Screenshot

After some time, your app will be build and this option will be shown to you.

Build Your First Android Studio Project
Image Source: Android Studio IDE Screenshot

Just click on the "locate" option and it will option the location of your apk file. 

Build Your First Android Studio Project
Image Source: Android Studio IDE Screenshot

Use this file to install your app in your android mobile phone and test this app.

Suggestions / Queries

I hope this blog post was helpful for you and you enjoyed it. If you have any suggestions or queries, you can comment below or you can also contact us using our CONTACT US page.
Keep visiting our blog for more free mobile apps and free mobile games.
Stay Blessed.

Next Post Previous Post
No Comment
Add Comment
comment url