Android – First App

Android Studio Tutorial First App 

So far everything we discussed in the previous Chapters, they were needed to create the first Android App to be created in this chapter, so that you can understand better how to create Android What part of the app is working, what, why and how.

We are assuming here that using the Android Development Environment methods discussed in the second chapter, we have done all the necessary setups for Android development on our local computer system and we are fully ready to develop our first Android App. Are ready.

So, let’s first create an Android App with Blank Activity using Android Studio , in which the View Part is not included because in this example we will perform the works related to View by Codes and this type of Android To create an app, we can follow the following steps:

First, click on the ” Start a new Android Studio project ” option-

first app

As a result, we see the Dialog Box as below, on which we have to specify the name of our Android App, Company Domain, Newly Create Package Name and the Location of the Package and click on Next Button.

first app

As soon as we click on the Next button, we have the next screen display as per the following picture, where we have to select the Target Device and API Level of our developed Android App.first app

After selecting the Target Device and API Level, as soon as we click on the Next button, we have the next Screen Display, where Templates of various types of Android Apps that can be created are visible, where we can see our need According to this, we can select any specific type of Android App Template and on this screen, whatever type of Android App Template we select, in the upcoming Android App Directory Structure to be created, we can create any new File / Directory according to our need. Can add.

Since we have to create an Android App with an Empty Activity, we have selected the Empty Activity Option on this screen and clicked on the Next button.first app

As a result, we have the next Screen Display as follows, where by default the “ Generate Layout File ” checkbox is checked. Since we do not want the Layout File Generate for our Android App, we have unchecked this checkbox.

Our Android App starts creating as soon as you click the Finish Button that appears on this screen and the “ Creating project… ” screen appears as follows:

first app

When the entire directory structure of Auto-Generated Files and Directories related to our Android App is completely created, then we see our Android App in Android Studio as follows.

first app

Whichever template we use to create our Android App, we get a complete Android App that can be run by clicking Run => Run ‘app’ menu option or through Shift + F10 Shortcode. .

We whenever a new Android App Project or new Activity is to Create, then two Files Create associated with each Activity occurring Create. The first file is a Layout File where the Visual Part that appears on the screen of the App is defined through XML Codes, while the second File is a Java Class File, in which Java Codes related to controlling that Visual Part are written Go.

The Java File seen in the above picture is the main activity’s Java Class File to be created for our Android App, located at / app / java / / Location of our Android App , while this Java Class The XML Layout File Associated with the file is located at / app / res / layout / Location as shown next .

In which the GUI Design Part which appears in Design Mode is actually representing the screen of our Android Device where from the GUI Controls section we can drag and drop the control to the GUI Design Part as per our requirement and without a single Even writing the XML code of the line, we can design the front-end screen of our Android App.

At the same time we just do any Drop the GUI Design Part by Drag the Control are its different types Select the Control Properties can Set through the Properties Window.first app

In this Design Mode as we visually design the screen of our Android App, the XML codes related to the design are automatically generated in the background , which we can see by selecting the text mode as follows:

first app

The biggest feature of this Text Mode is that we can also see a preview of the screen output of our Android App. That is, we can also know how our app will appear on the screen of Android Device while running.

Since this Android App to be created automatically is a completely Complete App, we can also run it by Shift + F10 Key Combination, as a result of which we have the following Output Display as follows:

first app

Since this Android App is a complete App in itself, we can understand that all the resources and codes generated for this Android App are generated automatically, at least all of them are required by any Android App Compulsory and If we understand the various components of this Android App and their role in Android App, then almost all fundamentally important things related to developing any Android App will be completely cleared.