Introduction
In this blog, I will explain about XML(eXtensible Markup Language) in an Android Application and how many XML files are available in an Android Application, using Android Studio.
In this blog, I will explain about XML(eXtensible Markup Language) in an Android Application and how many XML files are available in an Android Application, using Android Studio.
Requirements
- Windows 10 (OS free available source in online (https//www.microsoft.com/en-in/software-download/windows10)).
- Android Studio 2.1.3 (free source available in online(https//developer.android.com/studio/index.html?gclid=CNP3qbH5htECFdiKaAodeFIKtA)).
XML stands for an eXtensible MarkUp Language and it is like HTML (Hyper Text MarkUp Language). it should be mainly used for design purposes because XML is a lightweight layout.
User Interface
The user interface interacts with the user in an Application. It should be used for designing purposes.
The code given below is mentioned an Activity_main.xml.
User Interface
The user interface interacts with the user in an Application. It should be used for designing purposes.

The code given below is mentioned an Activity_main.xml.
- <?xml version="1.0" encoding="utf-8"?>
- <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:tools="http://schemas.android.com/tools"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:paddingBottom="@dimen/activity_vertical_margin"
- android:paddingLeft="@dimen/activity_horizontal_margin"
- android:paddingRight="@dimen/activity_horizontal_margin"
- android:paddingTop="@dimen/activity_vertical_margin"
- tools:context="xyz.rvconstructions.www.myapplication.MainActivity">
- <Button
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="New Button"
- android:id="@+id/button"
- android:layout_centerVertical="true"
- android:layout_alignParentLeft="true"
- android:layout_alignParentStart="true" />
- <EditText
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:id="@+id/editText"
- android:layout_alignParentLeft="true"
- android:layout_alignParentStart="true"
- android:layout_alignParentTop="true"
- android:layout_alignParentRight="true"
- android:layout_alignParentEnd="true" />
- <RadioButton
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="New RadioButton"
- android:id="@+id/radioButton"
- android:layout_above="@+id/button"
- android:layout_alignRight="@+id/editText"
- android:layout_alignEnd="@+id/editText" />
- </RelativeLayout>
Now, you will see the design page. It is like XML and I have mentioned parent and child view group.

Different XML files are available in our Application.
Layout XML file
The layout XML is used for actual User Interface. It is like views and elements, such as on TextView, Button, Spinner, RadioButton and Extra.


Different XML files are available in our Application.
Layout XML file
The layout XML is used for actual User Interface. It is like views and elements, such as on TextView, Button, Spinner, RadioButton and Extra.

The code snippet is given below, which is mentioned in activity_main.xml.
- <?xml version="1.0" encoding="utf-8"?>
- <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:tools="http://schemas.android.com/tools"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:paddingBottom="@dimen/activity_vertical_margin"
- android:paddingLeft="@dimen/activity_horizontal_margin"
- android:paddingRight="@dimen/activity_horizontal_margin"
- android:paddingTop="@dimen/activity_vertical_margin"
- tools:context="xyz.rvconstructions.www.myapplication.MainActivity">
- <Button
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="New Button"
- android:id="@+id/button"
- android:layout_centerVertical="true"
- android:layout_alignParentLeft="true"
- android:layout_alignParentStart="true" />
- <EditText
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:id="@+id/editText"
- android:layout_alignParentLeft="true"
- android:layout_alignParentStart="true"
- android:layout_alignParentTop="true"
- android:layout_alignParentRight="true"
- android:layout_alignParentEnd="true" />
- <RadioButton
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="New RadioButton"
- android:id="@+id/radioButton"
- android:layout_above="@+id/button"
- android:layout_alignRight="@+id/editText"
- android:layout_alignEnd="@+id/editText" />
- </RelativeLayout>








Join the conversation! Your thoughts help the community grow.