16
Sep

Cómo CREAr UNA APP desde el celular | Primera App


Hello friends of youtube Today we will learn to program Android applications from our mobile and let´s go to it [Music] Very well once in our application we go to the FILE option we go to the option NEW and New Android Project and we begin to enter the data of our project First let’s enter the name of our application in our case is going to be Myapp You are going to put the name you want of
course Then we put the package name with the name of the application at the end I recommend you to keep Main Activity and Layout name with the same name so you can then use these codes in other projects now we will open our activity main file which contains the user interface Here we will first organize this text that already contains by default a TextView this TextView simply shows a text We are going to edit this View at our convenience we will add features first let’s go to start by changing the ID this is the way we have to identify the particular views or layouts that are the designs that will contain different Views either text buttons or any other type the following below are the width the height and the gravity That is something we will see later Now let’s change the text to say Dale LIKE and we can do a quick test we just have to push it up here on the button install and open the application It´s simply going to show the application with the text press LIKE in the center we can then continue editing our file and we will simply copy and paste our View to get two we change the ID because they should always be different and we change the text We are going to put in this case to say Activate the Bell and we can then test it This is the LinearLayout that contains the TextViews The second text is missing because the first is occupying all the space We have to change this feature which is the hieght so let’s go to our code and let’s modify it ok here you can see it match_parent let’s change it and let’s write wrap_content Now instead of adjusting to the size of its container it is going to wrap its content We can now test it but first we have to change the value of our second view and let´s test it Very well this is the LinearLayout and its content in vertical order We need to define a gravity to the LinearLayout so we get the content in the center In the video description you can find a link that will take you to the project codes Well we add the code android:gravity=¨center¨ and so we are defining that all the content in this Layout will appear in the center as you can see And we will continue adding other details in this case textColor it will define the color of our text and let’s put a red color It is written just like that textColor=¨#ff0000¨ we will also control another aspect of our text as in this case is going to be the size with the code textSize let’s define it with value 20 and let’s test it And we will continue adding another text to our user interface Let’s copy and paste our text Of course we always must modify the ID they must be different this is very important because then we need to know what we are working with from code We edit the text that will display ok let’s edit the size to be shown bigger (。ŏ﹏ŏ) and the background color with the code background=¨#ff0000¨ we are going to put the red color
[#ff0000] and we will put the white color to the text
[#ffff] and we test it Well you will say it was all there very right together we are going to add margin and to do so we just have to write android:layout_margin we give it a value of 20 We simply copy and paste this value to each text And with this we have finished I hope you liked it remember to subscribe and activate the bell to continue with more and see you next time ¯_(ツ)_/¯

Tags: , , , , , , , , , , , , , , , , , , , , , , , ,

There are no comments yet

Why not be the first

Leave a Reply

Your email address will not be published. Required fields are marked *