How to create your first Android project - Codiclick

share

How to Create Your First Android Project

Adverts


In the previous entries we saw different generalities about Android, from what we should take into account, passing 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 is loaded, in this case we select Empty Activity and click on Next

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


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

NOTE: It is very important to clearly define the name of the package, as it will refer to the package and the company when it is published in the app store, in the example below we see the path of the package defined for the App StropperS published in 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 doing so, 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 column “CUMULATIVE DISTRIBUTION” the percentage of use of the Android version on current devices is shown, this data is obtained based on the statistics collected by the platform, we select the version with which to work 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: When defining which version is the one we want as a minimum SDK, we are restricting the use of the App from the version selected in advance, for our example you want to decide that we can only install the app in versions 5.0 in advance, it cannot be installed in 4.4 for example.

Basic structure.


After a while the project is built, it is very important that we have access to the internet because the tool starts to download the necessary dependencies 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 the AndroidManifest.xmlit's him build.gradle among others that we will analyze later.


Also, 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”



Creation of Graphic Interface.


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 tab “Project” that allows us to drag and drop components, as well as modify the components through their properties.



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


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


In this visualization we can know the structure of the screen and the components that compose it as well as their properties, note that for example for the “Hello World!” which is created by default, a component is used and this is in a content manager called ConstraintLayout that 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'll do that process in a future post.

And that's it, that's all for now, I hope it 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 😉