4. WHAT IS ACTIVITY MAIN.XML | CHANGE TEXT-1 | ANDROID APP DEVELOPMENT

Published: 16 February 2016
on channel: EngineersDream
25,151
235

In this video you will see in detail what is activity_main.xml. Activity main.xml is the most important file in Android Studio. It is inside this file that we design the graphical elements like Button, TextView, EditText,Checkboxes to name a few.

In this Change Text app Part -1 we will take a TextView attribute and Button attribute in activity_main.xml file. The id for the TextView attribute is textview and that for Button is button

Both the attribute have their individual width and height. The width and height can be set in 3 ways
1. wrap_content - Wraping the text according to the view of the attribute.

2. match_parent - Regardless of the text inside the attribute the view of the attribute will occupy the entire width and height of the parent layout.

3. Density Pixels(dp) - Manually set the width and height of individual attributes.

Parameters to the left side of attribute are callled as attribute name and that to the right are called as attribute values

Inside the Button attribute we define attribute name called the onClick which helps to create a method that we can later use in MainActivity.java file.

Once attribute in .xml file are created they must be linked to variables in .java file so that the id value gets stored in variable.


Watch video 4. WHAT IS ACTIVITY MAIN.XML | CHANGE TEXT-1 | ANDROID APP DEVELOPMENT online without registration, duration hours minute second in high quality. This video was added by user EngineersDream 16 February 2016, don't forget to share it with your friends and acquaintances, it has been viewed on our site 25,151 once and liked it 235 people.