0% found this document useful (0 votes)
18 views4 pages

Practical 15-1

The document is an XML layout for an Android application that implements a registration form. It includes fields for first name, last name, gender selection via radio buttons, language preferences with checkboxes, and a submit button. The layout is designed using a RelativeLayout with various UI components styled appropriately.

Uploaded by

labadeshravani
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views4 pages

Practical 15-1

The document is an XML layout for an Android application that implements a registration form. It includes fields for first name, last name, gender selection via radio buttons, language preferences with checkboxes, and a submit button. The layout is designed using a RelativeLayout with various UI components styled appropriately.

Uploaded by

labadeshravani
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

// Program to implement Toast

<?xml version="1.0" encoding="utf-8"?>


<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/main"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity"
android:layout_margin="10dp">

<TextView
android:id="@+id/tv1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Registration Form"
android:textSize="40dp"
android:layout_marginTop="40dp"
android:textStyle="bold"
android:textColor="#673AB7"
android:gravity="center"
android:layout_marginBottom="10dp"
/>

<EditText
android:id="@+id/et1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="First Name"
android:textSize="20dp"
android:gravity="center"
android:layout_below="@+id/tv1"
android:layout_marginTop="10dp"
/>

<EditText
android:id="@+id/et2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Last Name"
android:textSize="20dp"
android:gravity="center"
android:layout_below="@+id/et1"
android:layout_marginTop="10dp"
android:layout_marginBottom="20dp"
/>
<TextView
android:id="@+id/tv2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Select Your Gender :"
android:textSize="20dp"
android:layout_below="@+id/et2"
android:textStyle="bold"
android:textColor="#673AB7"
/>

<RadioGroup
android:id="@+id/rgb"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/tv2">

<RadioButton
android:id="@+id/male"
android:layout_width="80dp"
android:layout_height="wrap_content"
android:text="Male"
android:textSize="20dp"
/>

<RadioButton
android:id="@+id/female"
android:layout_width="110dp"
android:layout_height="wrap_content"
android:text="Female"
android:textSize="20dp"
/>
</RadioGroup>

<TextView
android:id="@+id/tv3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Select Languages :"
android:textSize="20dp"
android:layout_below="@+id/rgb"
android:textStyle="bold"
android:textColor="#673AB7"
/>

<CheckBox
android:id="@+id/js"
android:layout_width="150dp"
android:layout_height="wrap_content"
android:text="Javascript"
android:textSize="20dp"
android:layout_below="@+id/tv3"
/>

<CheckBox
android:id="@+id/java"
android:layout_width="150dp"
android:layout_height="wrap_content"
android:text="Java"
android:textSize="20dp"
android:layout_below="@+id/js"
/>

<CheckBox
android:id="@+id/php"
android:layout_width="150dp"
android:layout_height="wrap_content"
android:text="Php"
android:textSize="20dp"
android:layout_below="@+id/java"
/>

<CheckBox
android:id="@+id/android"
android:layout_width="150dp"
android:layout_height="wrap_content"
android:text="Android"
android:textSize="20dp"
android:layout_below="@+id/php"
/>

<Button
android:id="@+id/btn1"
android:layout_width="200dp"
android:layout_height="wrap_content"
android:text="Submit"
android:textSize="20dp"
android:layout_below="@+id/android"
android:layout_centerHorizontal="true"
android:layout_marginTop="20dp"
/>
</RelativeLayout>
Output:

You might also like