How to create your first Android project - Codiclick

share

How to create your first Android project

Adverts


In previous entries we saw different generalities about Android, from what we should take into account, through the Kotlin programming language, the types of applications, characteristics of the operating system, to the installation of the tool...

Now, in this opportunity we will see how to create our first Application!

In this entry we will focus mainly on the creation of the project and the basic structure provided by the tool, which will serve as a basis for future registrations where we will further complement our application.

Project Creation.


When starting Android Studio, if it is the first time, the tool gives us the possibility to create a new project, otherwise, in the toolbar we select new project

Once this is done, the window where we choose the type of project we want loads, in this case we select Empty Activity and click Next

Subsequently, the creation window is loaded, here we define the project name, the package name, the path where the project will be stored, the programming language and the minimum SDK with which we are going to work.


If we don't know what the minimum SDK is, we can click on “Help me choose”

NOTE: It is very important to clearly define the package name, as it is what will reference the package and the company when it is published in the app store. In the following example we see the package path defined for the App StropperS published on Google Play. (https://play.google.com/store/apps/details?id=co.chenao.stroopers&hl=es_419&gl=US)

Going back to project creation, if we don't know which version to choose for the minimum SDK, we can click on “Help me choose”

When we do this, a window is loaded where we can see the Android versions from the most used to the most recent, as well as the details of each version.


In the “CUMULATIVE DISTRIBUTION” column the percentage of use of the Android version on current devices is shown. This data is obtained based on statistics collected by the platform, we select the version to work with and click OK.

(If you want to know a little more about versions, you can find more information in the introduction to Android app development entry)


Observation: By defining which version we want as a minimum SDK we are restricting the use of the App from the version selected in advance, for example if we decide that we can only install the app in versions 5.0 in advance, we cannot install it in 4.4 for example.

Basic structure.


After a moment the project is built, it is very important that we have access to the internet as the tool starts to download the dependencies necessary for its construction, at the end we can see the structure of the project, the file activity_main.xml and the class MainActivity.kt with the default code.


We can also see files like AndroidManifest.xmlit's him build.gradle among others that we will analyze later.


Additionally, if an emulator has already been created, it will automatically load the available emulator or configured physical device, which in my case I called “Pixel 2 API 28”



Graphic Interface Creation.


If we insert the file activity_main.xml We will see a graphical client from which we can create our screens, here we will see the “Project” which allows us to drag and drop components as well as modify components through their properties.



We can also find the “To divide” which allows us to split the screen into xml code section and screen display section, here we can create the components through code although we can switch between the two views.


We could also work on the “code” one that gives us work with code only, but the “Split” view is more recommended.


In this visualization we can learn about the structure of the screen and the components that make it up as well as its properties, note that for example for “Hello World!” which is created by default, a component is used and this is in a content manager called ConstraintLayout which allows you to place components with positions relative to the screen or other components.



If we go to the design view, we can modify the screen to our liking, we will do this process in a future post.

And that's it, that's all so far, I hope this helped you get started creating your own apps.





It may also interest you.




Is there anything you want to add or comment about this entry? feel free to do….And if you liked it... I invite you to share Y Subscribe by clicking on the “Join this site” button to hear more posts like this one 😉