Creating Your First Android Application with Android Studio
In today’s video, we will discuss how to create your first android application with android studio. Android Studio is an integrated development environment (IDE) that provides easy and efficient tools for android application development.
About The Author
Myself, Muhammad Zubair and this channel is all about showing you how to become a highly paid id pro really fast.
Let’s learn how we can create the simplest of applications for beginners. First, we need to create a new project into our android studio. If you are using android studio for the first time after installation, you will have the option to create a new project; otherwise, go to your files, and from there, go to your “new.” Here, we have various activity options that we can choose from, such as Google Maps activity, Google Pay activity, and a lot more, but let’s stick to the empty activity for now.
Now, click on “next,” and give the name to your application. The name that you are going to set here will remain the same throughout your application development. Here, we have the package name which can be changed, but it’s recommended to go with the default one. Then we have the location, where the project is going to get saved. After that, we have language; we have two language options – Java and Kotlin. Go with Java. Then we have the minimum SDK; currently, the set value is android 5.0 Lollipop, which means my application will be supported for all the devices that are running at least Lollipop. If you go with Jelly Bean, your application will be supported for all the devices that are running at least Jelly Bean android on their devices. Now just click on “finish,” and we have successfully created our first project.
It will take some time for the first time because it will build a lot of things, as you can see here, it says gradle build. After it’s done, we will explain everything to you about what we get by default and how to create our layout.
The Default Folders
After creating our first project, we get these default folders:
- MainActivity.java class – This file contains all of our business logic related to Java.
- activity_main.xml – This is the file where we create our layouts. We have different widgets like button, image view, fragment controller, and many more options to choose from. We will use some of these options to create our first layout.
Now let’s say I want to create one more java file, or I’m going to create an application in which I might have to use more than one java file. For that, just right-click here and go to “new.” Here, it says java class, just click on it, and you will be able to create a new java class in your project.
Let’s say you want to add some of the images in your layout. We have a folder named “drawable,” where we have the default images. Now, I want to add the image of skills build into my application. For that, we need to import or copy-paste that image in this drawable folder, and only then we’ll be able to use that image.
To create a layout, first, go to your palette, and select the widget you want to use. Drag and drop it onto your layout. After that, you have to constraint all the widgets towards every side of the screen, and only then we’ll be able to use them perfectly. Resize your widgets and images by setting the values from here or by dragging and dropping them.
So, that’s how you can create your first android application with android studio. Keep adding new features and functionalities to make it more engaging and user-friendly.