How to start an Android studio project - Main image

Intermediate

How to start an Android studio project

Creating a new Android Studio project is very easy, but also very important. Take at our guide and follow these couple of simple steps.

Miha Cirman - CodeBrainer
Miha Cirman
5 min read

When starting your path to becoming an Android developer, the first you really should learn is how to start an Android studio project. All things considered, this step is not to be taken likely as this the place where you select and configure essential foundations for your Android studio project

We are going to take a look at:

  • How to start your first Android studio project
  • What parameters to choose for developing a mobile app
  • What setting to choose so that most Android users will be able to use your app
  • A quick overlook of the MainActivity
  • A quick overlook of the XML file
  • Setting up your Android studio for a better overlook

 

First, before we go any further, please download and install Android studio. Once you have done that, go ahead and open it. 

Programming is a skill best acquired by practice and example rather than from books. Have a look at our Android Development course and get the skills you need.

Start Now

 

Step by step guide to our first Android studio project

When the "Welcome to Android Studio window" opens go to the right side, and select "Start a new project in Android Studio". 

Android studio project - Welcome

 

First screen

In the first place, we have to decide on what kind of android device we want to develop our app. Are options are: Phone and Tablet, Wear OS (Android watch), TV and Android things. For example, we are going to choose “Phone and Tablet” and start an Android studio project for a phone. In the field below, make sure you select an empty activity.

Android studio project - First screen

And click next.

 

Second screen

Let’s name the project MiniProgram. There is no need to change the package name at this point, so you can leave it as it is. Also, for this example, it is better if you keep the existing project location. 

Android studio project - Second screen

Now you must select the language you want to code in. As you can see, Kotlin is getting more and more popular, and it is also a default selection. But for our example we are going to use Java, so click the drop-down menu and select Java. 

Android studio project - Java

Then we have the drop-down menu where you have to choose an API level. The API level is a value that identifies the framework API revision. When creating new mobile apps, it is always wise to develop them for one of the most popular Android versions. It is wise to select an option that covers around 80% of devices. This way, you make sure that a higher percentage of Android users will be able to use your app.

Android studio project - API level

Given these points, we at CodeBrainer advise our students to choose API 22.

Android studio project - Choose API 22

Before you finish, you have two tick boxes that, for this example, should stay unticked.

Android studio project - Screen two finish

Click Finish to create the Android studio project and wait for the project to load.

In some cases, you might get a pop-up window asking you if you allow Android studio to have a network connection, just click allow to continue. Then be patient because it might take more than a minute to load.

Android studio project - Allow connection

 

Programming is a skill best acquired by practice and example rather than from books. Have a look at our Android Development course and get the skills you need.

Start Now

Taking a look at our Android studio project

Congratulations you have created a new Android studio project. Android Studio creates one layout XML file and one Java file for us. As you can see the MainActivity.Java file is already open. For example, if you had chosen Kotlin, then this would be a Kotlin file. 

AS project - First look 

MainActivity

In this file, you will find the code of the main activity. Furthermore, if you take a look at the left side window, you will find that the MainActivity.Java file is located in the Java folder that contains the Java source code files which are separated by package names.

AS project - MainActivity

 

XML file

Now, let's take a look at the XML file. Here you see the layout of the screen. Also, if you take a look at the left side window, you will find that the XML file is located in the res folder that contains all non-code resources like layout, UI string, and bitmap images. Take a look at all possible resource types.

AS project - XML file

Because we want to make the mock up a little bit bigger, we have to close a couple of windows around it.

Close the attributes window first. You will use this window in the future, to set properties for your components.

AS project - No attributes window

Next, we close the build window. Usually, the windows on the bottom show errors, and we use them for debugging purposes. As your knowledge grows, the use of them will increase, and these windows will become your best friends in all future Android studio projects. 

AS project - Final view

 

Next steps

New Android studio project is a place where all our projects start. If you want to share your project with a friend, take a look at our blog post on how to export an Android studio project

CodeBrainer is a great place to start your Android development path. Now you know how to start a project, check out our courses and start creating your first app.

 


Loading FB comments...